Skip to main content
Speech is one input to a graph agent. Events are the other. When a customer opens a payment link, completes a form, or finishes a transaction on your website, you want the agent to react immediately rather than wait for the user to say something. Event injection adds a REST endpoint, POST /v1/call/{run_id}/events, that lets your backend push named events into a live call. A matching event edge transitions the conversation and triggers proactive agent speech, all in under a second.

Configuring an event edge

Add edges with condition_type: "event" and an event_name. They are ignored during normal speech routing, so they coexist freely with LLM and expression edges on the same node.
A node can mix all three edge types: event edges (fire on external signal), expression edges (fire on context variables), and LLM edges (fire on user speech). Whichever input arrives first drives the transition.

Edge field reference


Firing an event

  • run_id is returned by POST /call for outbound calls or arrives in your webhook for inbound calls.
  • Fire-and-forget. The endpoint returns 202 as soon as the event is published.
  • properties are merged into the agent’s context_data, so they become available as {variable} substitution in node prompts and as variable references in expression edges.

What happens when an event arrives


How proactive speech stays natural

When an event drives a transition, the agent must speak without the user saying anything. Two design choices make this feel natural rather than scripted:
  1. Event properties are merged into context_data, so the new node’s prompt can reference them via {variable} substitution.
  2. The conversation history is not polluted with fake user messages. The agent simply produces a new assistant turn on the new node.
The result: a transcript that reads as consecutive assistant messages, exactly as a human agent would speak after seeing a screen update.

Latency

If a confirmation message never changes, point your event edge at a static node for the fastest possible response.

Worked example: payment confirmation

The agent waits while the user completes a payment on the bank’s website. Your backend fires payment_completed when the gateway confirms.

Graph config (3 nodes)

Backend code

The confirmation node is static, so the user hears the confirmation in ~50ms with no LLM call. The payment_failed node uses {error_reason} from the event’s properties to give the user a specific message.
Add more event edges (details_verified, payment_initiated, etc.) to walk the user through a longer flow. The pattern stays the same: one edge per event name, one HTTP call per step.

Notes on timing

  • Events never interrupt active speech. They are queued until the agent is at a safe point (no audio playing, no response in flight) and processed then.
  • If the user is mid-utterance when the event lands, the node transitions but the agent does not speak proactively. The user’s utterance routes on the new node, so the agent’s first words still feel responsive.
  • The run_id is all you need. The same endpoint works regardless of where the call is running.