A deterministic agent workflow removes ambiguity from every step: the agent always knows which endpoint to call next, which identifier to carry forward, and when to stop. This page defines the full sequence, the state the agent must maintain, branching rules for result delivery, stop conditions, and error handling — so you can build an agent that completes the workflow reliably without repeating steps or losing identifiers.Documentation Index
Fetch the complete documentation index at: https://docs.seamless.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Workflow sequence
Choose an authentication method
Authorization: Bearer. For an API key, create one under Settings → Public API, store it for the Token header, and skip the token request step.Decide whether the task starts with companies or contacts
Run the matching search step
Save the search result identifier
searchResultId before proceeding. Do not advance to the next step until this identifier is stored.Start the matching research request
searchResultId to Research companies or Research contacts. The API returns a requestId.Save the request identifier
requestId returned by the research endpoint. Do not overwrite the searchResultId — keep both identifiers stored separately until the workflow completes.Choose one result delivery method
requestId for polling or to match against incoming webhook payloads.Recommended agent state
The agent must persist these values across steps. Losing any of them requires restarting from an earlier step.| Value | When to store it | Why it matters |
|---|---|---|
| Access token or API key | After authentication | Required as a header on every subsequent API request |
searchResultId | After search | Passed to the research endpoint to identify which record to enrich |
requestId | After research | Passed to the polling endpoint or matched against webhook payloads |
Workflow type (company or contact) | Before research | Determines which endpoint family to call at every step |
Branching rules
searchResultId from a previous step.How to choose a result delivery method: use webhooks when your application can receive incoming POST requests at a public HTTPS endpoint. Use polling when you want to check status on demand without a public endpoint. Use both only when your application explicitly requires both delivery paths for the same request.Stop conditions
The agent must stop and not retry when any of the following occurs:- The agent received the completed research result and downstream logic has what it needs.
- The agent cannot determine which endpoint family to call next.
- The agent does not have the identifier required for the next step.
- The research request returned an
errorpoll status (or a non-terminal status you cannot resolve).
requestId and error status to the caller. Do not retry automatically.
Error handling
- Authentication fails — stop and request a valid access token or API key before calling any search or research endpoint.
- Search returns no usable result — stop and return the missing target information to the caller. Do not start a research request without a confirmed
searchResultId. - Research poll returns
errorstatus — return therequestIdand status to the caller. Surface this to the caller rather than retrying automatically. - Polling does not return a completed result — keep the saved
requestId, wait before polling again, and continue polling until the request reaches a terminal status. - Webhook payload cannot be matched to a saved
requestId— ignore the payload or route it for manual review. Do not process unmatched payloads.
Recommended workflows
- Company
- Contact
Search companies
Research companies
searchResultId to Research companies. The API returns a requestId.Retrieve the result
- Webhooks — wait for Seamless to
POSTthe result to your endpoint. See Receive research results with webhooks. - Polling — call Poll company research results with your
requestIduntilstatusisdone.
Troubleshooting
The agent repeats earlier steps unnecessarily
The agent repeats earlier steps unnecessarily
searchResultId and requestId as separate named values as soon as each is received. On subsequent steps, read the stored value instead of re-running the previous request. Re-running search when you already have a searchResultId wastes credits and introduces non-determinism.The agent does not know whether to use polling or webhooks
The agent does not know whether to use polling or webhooks
POST requests at a public HTTPS endpoint. Use polling when you want to check status on demand or cannot expose a public endpoint. If you are unsure, start with polling — it requires no additional setup. See Choose the right workflow for a full comparison.The agent cannot continue after research starts
The agent cannot continue after research starts
requestId was saved immediately after the research response. If it was saved, continue with your chosen delivery method: call Poll company research results or Poll contact research results with the requestId, or wait for the webhook payload and match it against the stored requestId. Do not re-submit the research request.Research returned an error status
Research returned an error status
requestId and poll status (for example error or missing) to the caller. Resubmit the research request only after confirming the input searchResultId is valid and the account has sufficient credits. Check credit balance in Settings → Billing.