Invocation contract
Callers name a workflow, never a model, an agent, or a prompt template. That is the whole contract, and it is what lets the runtime change models or restructure a workflow’s steps without touching any caller.
Request
{
"actorId": "+61412345678",
"workflow": "dialler-agent",
"payload": { "phoneNumber": "+61412345678" }
}
| Field | Type | Required | Purpose |
|---|---|---|---|
|
string |
yes |
A name registered in |
|
object |
yes |
Workflow-specific input. Absent or null is treated as |
|
string |
no |
Stable per-contact identifier used for AgentCore Memory namespacing. Falls back to the session id when omitted. |
The session id is not in the payload — it comes from the AgentCore context
object that the platform supplies.
Response
One SSE event:
{
"session_id": "abc123…",
"data": {
"success": true,
"output": "…final step's text…",
"structured_output": { "…": "validated Pydantic model from the last step" },
"stop_reason": "end_turn",
"usage": { "inputTokens": 4210, "outputTokens": 890 },
"error": null,
"steps": [
{ "name": "analyse-history", "output": "…", "structured_output": {…}, "usage": {…}, "error": null },
{ "name": "prepare-brief", "output": "…", "structured_output": {…}, "usage": {…}, "error": null }
]
}
}
data is a WorkflowResult. On a missing workflow field the entrypoint yields
{"error": "workflow is required"} instead.
WorkflowResult field |
Meaning |
|---|---|
|
|
|
The last successful step’s text output; empty string on failure |
|
The last step’s validated Pydantic instance, when that step declared an |
|
|
|
Token totals summed across steps, when the provider reported them |
|
Populated when |
|
Per-step detail for multi-step workflows |
Available workflows
test
Direct passthrough to the dialler agent. Useful for smoke tests and for exercising the agent’s tools interactively.
{ "workflow": "test", "payload": { "prompt": "What is 2 + 2?" } }
Missing payload.prompt returns success: false with
"payload.prompt is required for the prompt workflow.".
dialler-agent
Two sequential steps producing a call brief from a phone number.
{ "workflow": "dialler-agent", "payload": { "phoneNumber": "+61412345678" } }
| # | Step | Depends on | Output schema |
|---|---|---|---|
1 |
|
— |
|
2 |
|
|
|
PrepareBriefOutput is the useful part for a caller:
class PrepareBriefOutput(BaseModel):
contact_summary: str
last_discussed: str
last_interaction_result: str
recommended_action: Literal["follow-up-call", "email", "sms", "no-action"]
action_content: str | None # draft email or SMS body
call_prompt: str | None # ready-to-use call script
urgency: Literal["high", "medium", "low"]
Full schemas: the dialler workflow.
Calling the runtime
AWS CLI
aws bedrock-agentcore invoke-agent-runtime \
--agent-runtime-arn arn:aws:bedrock-agentcore:us-east-1:625663093496:runtime/agentcore-XXXXXXXX \
--payload '{"workflow":"dialler-agent","payload":{"phoneNumber":"+61412345678"}}'
The ARN is the AgentRuntimeArn output of the CDK stack:
aws cloudformation describe-stacks --stack-name AgentCoreStack \
--query "Stacks[0].Outputs[?OutputKey=='AgentRuntimeArn'].OutputValue" --output text
Error behaviour
| Situation | Result |
|---|---|
|
Yields |
Unknown workflow name |
|
Required payload field missing |
|
A step raised |
|
A step’s declared dependency did not complete |
|
Structured output failed validation |
The step still succeeds; |
|
The last row is a deliberate choice: a schema mismatch degrades to raw text rather
than failing the whole workflow. A caller relying on |