Skip to content
Visual explainer 2h 30m to learn 5 steps

Event contract between a voice session and n8n

Send n8n a structured event with session ID, event ID, verified actor, consent state and requested slot, separate from the quick availability reply.

By Invicly Tech, , in n8n, AI Automation and Voice Agents. About 7 minutes to read.

Topic 25 of 43

In short

The quick availability reply and the slower workflow work are two different jobs. The voice session sends n8n a structured event with a session ID, an event ID, the verified actor, consent state and the requested slot. n8n reviews and acts later, then the caller is told the result.

Explained simply

A contract is an agreement about shape. The voice service and n8n agree on exactly what an event looks like, so neither side has to guess. You write the schema first, then build both ends to match it.

An event carries a session ID, so you can find the whole call later. It also carries an event ID that is unique for each event, so n8n can spot a duplicate if the same event arrives twice.

The event says who the caller is and whether they agreed to things like a text confirmation. Your server decides those facts. n8n only reads them.

Speed matters. The voice side asks n8n to take the event and gets an immediate answer. The review, approval and calendar write happen after that. When it is done, the caller is told by text or a call back.

Press Play on a diagram to walk through it one step at a time.

SequenceFast reply, slow review
Voice session
Tool adapter
n8n
  1. 1Propose booking for Tuesday 3 pm
    Voice session to Tool adapter: Propose booking for Tuesday 3 pm
  2. 2POST event with IDs, actor, consent, slot
    Tool adapter to n8n: POST event with IDs, actor, consent, slot
  3. 3202 Accepted (reply fast)
    n8n to Tool adapter: 202 Accepted (reply fast)
  4. 4Requested, awaiting approval
    Tool adapter to Voice session: Requested, awaiting approval
  5. 5Review, approve, write calendar
    n8n to n8n: Review, approve, write calendar
  6. 6Later: confirmation by text
    n8n to Voice session: Later: confirmation by text
FlowInside the n8n workflow
  1. 1
    Webhook trigger

    Receives the event.

  2. 2
    Validate and dedupe

    Check schema and event ID.

  3. 3
    Notify reviewer

    Approval request.

  4. 4
    Write calendar

    Only after approval.

  5. 5
    Confirm to caller

    Text or callback.

In depth

Design the schema

Write a JSON Schema for the event and keep a version field. Required fields: schema_version, event_id, session_id, type, actor, consent and slot. Use fixed values for type, such as booking.proposed. Reject unknown fields at the edge so the contract stays tight. Share the schema file between both teams, and bump the version for breaking changes.

  • schema_version for change control
  • Fixed values for type
  • Required and optional fields stated
  • One shared schema file

IDs and idempotency

Networks retry. The event ID makes a retry harmless: n8n stores seen event IDs and skips repeats. The session ID links every event of a call, which helps with debugging and reports. Generate the event ID on the sender, once, before the first attempt. Reuse the same ID on every retry.

SequenceA retry with the same event ID
Adapter
n8n
  1. 1POST event evt_1
    Adapter to n8n: POST event evt_1
  2. 2Timeout, no reply seen
    n8n to Adapter: Timeout, no reply seen
  3. 3Retry POST event evt_1
    Adapter to n8n: Retry POST event evt_1
  4. 4evt_1 already seen, skip
    n8n to n8n: evt_1 already seen, skip
  5. 5200 OK, no duplicate work
    n8n to Adapter: 200 OK, no duplicate work

Verified actor and consent

The actor field is set by your server after it checks the caller. Consent is set by the conversation, for example the caller agreed to a text confirmation. n8n should not infer either from free text. Also secure the webhook: use a secret header or other authentication supported by the Webhook node, and accept only HTTPS.

Reply fast, review later

Set the n8n Webhook node to respond immediately, or use a Respond to Webhook node early in the flow. The adapter gets 202 or 200 in milliseconds. The rest of the workflow validates the event, notifies a reviewer and writes to the calendar when approved. The final step sends the confirmation to the caller through the agreed channel.

  • Respond early from the webhook
  • Validate the event first inside n8n
  • Review and write in later steps
  • Send confirmation last

Learn it in 5 short steps

About 30m each. Track them with a timer in your plan.

  1. 1
    Define the event schema~30m
  2. 2
    Include session and event IDs~30m
  3. 3
    Carry the verified actor and consent~30m
  4. 4
    Reply fast, review asynchronously~30m
  5. 5
    Confirm back to the caller later~30m

Key points

  • Write the event as a versioned JSON schema before building the workflow.
  • Include session_id and a unique event_id so retries do not duplicate work.
  • Carry the verified actor and consent state. Do not make n8n guess them.
  • Reply to the voice session quickly. Do the slow review asynchronously.
  • Confirm back to the caller later by a channel they agreed to, such as text.

Key terms

Tap a card to flip it. 0/5 known

Examples

json
{
  "schema_version": "1",
  "event_id": "evt_01HZ-example",
  "session_id": "ses_8f3a",
  "type": "booking.proposed",
  "actor": { "caller_id": "c_123", "verified": true },
  "consent": { "sms_confirmation": true },
  "slot": { "start": "2026-12-08T15:00:00+00:00", "time_zone": "Europe/London", "duration_minutes": 30 }
}

One proposal event sent to an n8n Webhook node.

Send the event

The adapter posts the event to a placeholder n8n webhook, with a shared secret in a header. The same event ID is reused on a retry. Replace the URL and secret with your own and keep the secret out of source control.

bash
curl -sS -X POST https://n8n.example.com/webhook/booking-proposed \
  -H "Content-Type: application/json" \
  -H "X-Webhook-Secret: <secret>" \
  -d @event.json

Duplicate delivery

The first request times out on the voice side, but n8n did receive it. The adapter retries with the same event ID. n8n sees the ID in its seen list and stops. The reviewer gets one approval request, not two.

Quick reference

  • Write the schema first and version it.
  • event_id is unique per event and reused on retries.
  • session_id ties all events in one call together.
  • Actor and consent come from your server, not from n8n guesses.
  • Respond early from the webhook; do review later.
  • Authenticate the webhook and use HTTPS.

Common mistakes

  • Making the caller wait on the whole workflow instead of replying 202 and continuing.
  • No event ID, so a retried request creates two proposals.
  • Sending the full transcript when the workflow only needs the slot.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1What is the event ID for?

Question 2

2Who sets the verified actor field?

Question 3

3Why reply fast from the webhook?

Question 4

4On a retry, which ID should you use?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    List the required fields of the booking.proposed event.

  2. Exercise 2medium

    Write a JSON Schema fragment requiring event_id and slot.start as a date-time string.

  3. Exercise 3hard

    Design a dedupe step for n8n using a data table or database: what is stored and what happens on a repeat?

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Why not just send the whole transcript?
n8n needs only the structured fields. Less data means less privacy risk and a simpler contract.
How do I secure the n8n webhook?
Use HTTPS and an authentication option on the Webhook node, such as a header secret. Keep the secret out of source control.
What does 202 mean here?
Accepted: the event was received and will be processed later.

Go deeper

ShareXLinkedInWhatsApp