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

Handle long-running Agentik tools with explicit run states.

By [Agentik](/about.md). Updated: 2026-10-19.

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.

- [Connect your agent](/docs/clients.md)

## 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

| Checkpoint | Evidence required |
| --- | --- |
| Submission | Original Agentik run ID and any provider job ID. |
| Pending | Documented state and next retrieval instruction. |
| Terminal result | Actual output or error, plus billing state. |
| Accepted deliverable | Accessible file checked against the approved brief. |

## A prompt to try

[Connect your agent](/docs/clients.md), then use this prompt with your connected assistant. Keep credentials in the authorized connection.

```text
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.
```

## A related workflow

[AI video ads](/ai-video-ads.md). Hooks from your niche’s longest-running video ads, objections from YouTube reviews, then frames, clips, a voiceover and music.

Example tool-call maximum: at most $3.57.

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.

- [adspy/search-creatives](/providers/adspy/search-creatives.md)
- [adspy/get-creatives](/providers/adspy/get-creatives.md)
- [dataforseo/youtube-search](/providers/dataforseo/youtube-search.md)

[View every step, input and tool in the playbook](/ai-video-ads.md).

## 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. The editorial update date is 2026-10-19; provider terms and availability can change.

- [Asynchronous runs](/docs/async.md)
- [Idempotency](/docs/idempotency.md)

### Continue with Agentik

- [Async contract](/docs/async.md)
- [Execution errors](/docs/errors.md)

## Related guides

- [Error handling for paid tool calls](/ai-agent-tool-error-handling.md)
- [Video generation cost planning](/ai-agent-video-generation-costs.md)
- [MCP or REST for tool access](/ai-agent-mcp-vs-rest.md)

[Browse all agent tool guides](/agent-tool-guides.md)

---

[HTML page](/ai-agent-async-tool-workflows) · [Agent index](/llms.txt)
