1. Resolve the Agent and recipient
- Read the selected Agent account and confirm the channel is configured.
- Search Contacts by exact phone or email before creating another Contact.
- Read the Contact’s recent communication and any matching ongoing objective.
- Read Task limits.
- Query existing Tasks by recipient, Contact, stable external reference, and current state.
2. Define the goal and cadence
The Task should contain:type:call,text, oremail- the Agent account in
accountId - the channel-appropriate
target - complete
taskContext - an optional
scheduledForUnix timestamp - a stable
externalTaskIdfor reconciliation goal.completionCriteria- a
retryPolicythat retries only relevant unresolved outcomes
externalTaskId is correlation data, not an idempotency key. Always query before resubmitting an
uncertain request.
Example shape:
3. Create and save the Task identity
Create the Task with the same Agent in querytargetAccountId and body accountId. Save the
returned Task ID immediately.
If the create request times out or returns an uncertain server error, query by externalTaskId,
recipient, and recent time range before trying again.
4. Follow the complete outcome
Poll the specific Task until it reaches a terminal state or requires intervention. Inspect:attemptHistory- terminal
resultand outcome logsRef- each attempt’s conversation reference