Skip to content

How should my AI agent handle tools that take minutes to finish?

Handle long-running Agentik tools with explicit run states.

By Agentik · Updated

Long-running tools can return before the requested asset or data is ready. An agent should preserve the execution identifier, follow the documented retrieval path and wait for a terminal state before claiming completion. Agentik supplies run handling, while your agent runtime or application owns persistence, scheduling and the final acceptance check.

On this page

Distinguish gateway state from provider-job state

Some tools complete directly in the Agentik run. Others submit work to a provider and return a provider search or job identifier that requires a documented follow-up operation. Inspect the selected tool’s output and retrieval instructions before designing the loop.

A completed gateway request can therefore represent a successful submission rather than the final asset. Record both identifiers when relevant. The user’s requested deliverable is ready only when the required result has been retrieved and checked.

Use a retrieval policy with a clear stopping rule

Follow the tool’s retry or polling guidance and avoid a tight request loop. Keep the original identifier across reconnects and process restarts. Set a task-level time window after which the agent reports that work remains pending rather than falsely declaring success.

Only use cancellation when the tool supports it and the action is appropriate for the user’s task. Do not assume cancellation reverses provider usage already consumed or guarantees a refund. Review the actual final state and receipt.

Check the final result, not just the status code

For media, verify that the returned file is accessible and matches the requested format and content. For enrichment, inspect the returned records and coverage. A terminal status is necessary evidence, but it does not alone establish that the result satisfies the job.

Keep partial outputs and report missing work. If the workflow is paused because the runtime cannot remain active, retain the identifiers and explain how retrieval will continue. Do not imply that a prompt creates a hosted background scheduler.

What you pay for

Supported paid tools use Agentik's prepaid workspace balance. Inspect the selected tool's pricing units and maximum before approving a run; a reservation can differ from its settled charge. Funding fees, taxes and your model's usage are separate. Current terms are on the Pricing and Billing pages linked below.

Track a submitted video until review

This lifecycle is a state-handling template, not a generated clip or completed purchase.

Track a submitted video until review
CheckpointEvidence required
SubmissionOriginal Agentik run ID and any provider job ID.
PendingDocumented state and next retrieval instruction.
Terminal resultActual output or error, plus billing state.
Accepted deliverableAccessible file checked against the approved brief.

A prompt to try

Connect your agent, then use this prompt with your connected assistant. Keep credentials in the authorized connection.

Give this to your agent

Plan asynchronous handling for [Agentik tool and task]. Inspect_tool for submission output, run states, provider follow-up operations and polling guidance. Define persistent identifiers, a time window and the completion checks. Do not submit paid work until approved. After submission, follow the original run and any provider job instead of resubmitting. Distinguish request completion from the requested deliverable, and report partial output and consumed usage accurately.

Your agent should inspect the tools and ask for missing inputs before proposing any paid work.

AI video adsAt most $3.57

Hooks from your niche’s longest-running video ads, objections from YouTube reviews, then frames, clips, a voiceover and music.

10 video ads studied and 5 transcripts read, 3 YouTube reviews, one product page, 3 frames and 3 clips of 8 seconds, a 60-word voiceover and 24 seconds of music.

This catalog-based reservation maximum belongs to the playbook’s inputs, separately from this guide’s worked example. It is not an executed charge. Optional calls, funding fees, taxes and model usage are excluded.

View every step, input and tool in the playbook

Questions

Is HTTP 200 proof that generation finished?

No. Inspect the actual run and provider job state, then retrieve and validate the required output.

Does Agentik automatically schedule every follow-up?

Your agent or application owns orchestration unless the selected documented operation explicitly supplies that behavior.

Sources and next steps

Agentik publishes this guide. References below describe the product, its billing and the alternatives discussed. This page was updated on ; provider terms and tool availability can change.

Continue with Agentik

Connect your agent to 2,400+ tools for free

Sign in with Google or GitHub. No card required.