Skip to content
Visual explainer 10h to learn 6 steps

n8n capstone: build the voice desk with a mock calendar

Connect simulated speech or transcripts, a mock availability lookup, an n8n proposal workflow, review and a mock calendar update.

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

Topic 41 of 43

In short

You build the desk locally with no paid services. A transcript mode stands in for speech, a small mock service holds the calendar, and n8n runs the proposal, review and update. Each step leaves evidence you can inspect.

Think of it like this: It is a flight simulator: the controls and checks are real, but nothing leaves the ground.

Explained simply

In this topic you build the desk on your own computer. You need Docker, a pinned n8n image and a small mock calendar service. You do not need a microphone or a phone number. A transcript runner sends fixed lines, such as Book me Tuesday at ten, to stand in for speech.

First you start n8n and the mock calendar with Docker Compose. Then you build three things: an availability lookup that only reads, a proposal workflow that starts with a Webhook node, and a review step that uses the Wait node.

After the reviewer approves, the workflow calls the mock calendar with the event key. The mock service remembers keys it has seen. A second call with the same key returns the earlier result and makes no new booking.

Finally every run writes an audit record: session, execution ID, proposal, decision and result. If you can read the audit record and explain what happened, the build is done.

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

LayersLocal lab parts
  1. 1
    Transcript runner

    Replays fixed caller lines

  2. 2
    Voice tool adapter

    Schema check and availability lookup

  3. 3
    n8n proposal workflow

    Webhook, validation, Wait for review

  4. 4
    Review form or approve link

    Needs a reviewer credential

  5. 5
    Mock calendar service

    Applies updates by event key

CompareSafe update versus unsafe update
Idempotent
  • Checks the event key first
  • Repeat call returns the old result
  • One booking per approval
  • Outcome is saved
Naive
  • Writes on every call
  • A retry makes a second booking
  • Lost acknowledgement causes doubles
  • No record of the outcome
FlowBuild order, one milestone at a time
  1. 1
    Start lab
  2. 2
    Transcript mode
  3. 3
    Availability tool
  4. 4
    Proposal workflow
  5. 5
    Review
  6. 6
    Idempotent update
  7. 7
    Audit

In depth

Local lab setup and prerequisites

You need Docker with Compose, a terminal, curl, and a pinned n8n release. Pin the image tag to one version, written here as a placeholder, so everyone gets the same behaviour. Check the node names against that version in the docs.

Start n8n and the mock calendar together. Set a fixed encryption key through an environment variable so credentials survive restarts, and keep that key out of Git. Use placeholder credentials only.

Expected evidence: the editor opens on the local port, the mock calendar answers a health check, and a test webhook execution shows in the executions list.

  • Docker and Docker Compose installed
  • Pin n8n to one tag, such as a version placeholder
  • Set N8N_ENCRYPTION_KEY, keep it out of Git
  • Mock calendar answers a health check

Transcript mode and the availability tool

The transcript runner is a tiny script that posts fixed JSON lines to the adapter. Because the lines never change, every run is repeatable.

The adapter does three jobs. It checks the input shape. It extracts a date range from the text, and when the date is unclear it asks a question instead of guessing. It calls the availability tool, which reads the mock calendar and returns a few slots.

The tool is read-only and has a short timeout. If it fails, the assistant says it could not check times and offers to try again. It never invents a slot.

SequenceTranscript run with a timeout
Runner
Adapter
Mock calendar
  1. 1Fixed line
    Runner to Adapter: Fixed line
  2. 2Availability query
    Adapter to Mock calendar: Availability query
  3. 3No answer in 2 seconds
    Mock calendar to Adapter: No answer in 2 seconds
  4. 4Could not check times, try again
    Adapter to Runner: Could not check times, try again

Proposal workflow and authenticated review

The proposal workflow starts with a Webhook node protected by a header credential. A Code or IF step validates the body. A lookup against stored event keys stops repeats. Valid new events notify the reviewer and move to a Wait node.

The Wait node pauses the execution and resumes when a call arrives on its resume URL, or when a form is submitted. Check the Wait node page in the docs for the options in your pinned version.

Authenticated review means the approve call must carry a reviewer credential or a signed single-use token, not an open link. Add a timeout on the Wait node so unanswered proposals expire.

  • Webhook with header authentication
  • Validate shape, then check event key
  • Notify reviewer, then Wait
  • Approve call needs credentials
  • Wait timeout leads to expired

Idempotent update and the audit record

After approval the workflow sends the update to the mock calendar with the event key. The mock service stores each key with its result. A repeat returns the stored result and sets a flag such as duplicate: true.

This also fixes the lost acknowledgement problem. If the write worked but the reply was lost, n8n may retry. The key makes the retry harmless.

The last node writes the audit record. Include session ID, execution ID, event key, decision, reviewer, result and time. Leave out audio and phone numbers.

  • Key stored with result
  • Retry returns the saved result
  • Audit: IDs, decision, result, time
  • No audio or personal data

Learn it in 6 short steps

About 1h 40m each. Track them with a timer in your plan.

  1. 1
    Run a transcript or simulated speech mode~1h 40m
  2. 2
    Wire the availability tool~1h 40m
  3. 3
    Build the proposal workflow~1h 40m
  4. 4
    Add authenticated review~1h 40m
  5. 5
    Apply idempotent calendar updates~1h 40m
  6. 6
    Write an audit record~1h 40m

Key points

  • Start with transcript mode. Add real speech later only if you want to, and treat it as optional.
  • The availability tool is read-only and returns only the slots the caller may see.
  • The review step uses the n8n Wait node, which pauses the execution until an approval arrives.
  • The calendar update uses the event key, so a replay changes nothing.
  • Every run writes one audit record with session, execution and proposal IDs.

Key terms

Tap a card to flip it. 0/5 known

Examples

bash
curl -s -X POST http://localhost:8080/transcript \
  -H "Content-Type: application/json" \
  -d '{"sessionId":"sess_demo_01","text":"Book me Tuesday at ten"}'
# expect: {"slots":["slot_2026-12-08T10:00"],"state":"offered"}

Replay a fixed transcript against the adapter. Names are placeholders.

A minimal Compose file for the lab

Two services: n8n on a pinned tag and the mock calendar. The key and tag are placeholders. Put real values in an env file that stays out of Git. Cleanup: run docker compose down -v when you are done.

yaml
services:
  n8n:
    image: n8nio/n8n:<pinned-version>
    ports: ["5678:5678"]
    environment:
      - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
    volumes: ["n8n_data:/home/node/.n8n"]
  mock-calendar:
    build: ./mock-calendar
    ports: ["8081:8081"]
volumes:
  n8n_data:

Idempotent update in the mock calendar

The mock service keeps a map of event keys to results. On a new key it books the slot and saves the result. On a known key it returns the saved result without booking again.

ts
const seen = new Map<string, object>();

export function apply(key: string, slotId: string) {
  const prior = seen.get(key);
  if (prior) return { ...prior, duplicate: true };
  const result = { slotId, status: "confirmed" };
  seen.set(key, result);
  return result;
}

Quick reference

  • Pin the n8n image tag and set N8N_ENCRYPTION_KEY outside Git.
  • Use transcript mode first. Real speech is optional.
  • Availability tool: read-only, short timeout, never invent slots.
  • Webhook node needs authentication. Review calls need credentials.
  • Wait node pauses until resumed. Set a timeout so proposals expire.
  • Update by event key. A repeat returns the saved result.
  • Cleanup: docker compose down -v removes containers and volumes.

Common mistakes

  • Using real names, phone numbers or credentials in the lab. Use synthetic data only.
  • Approving through a link anyone can open. The review must be authenticated.
  • Skipping the audit record because the booking worked.

Quick quiz

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

Question 1

1Why pin the n8n image to one tag?

Question 2

2What should the assistant do if the availability tool times out?

Question 3

3Which node pauses the workflow until a reviewer acts?

Question 4

4A write succeeds but the acknowledgement is lost and n8n retries. What prevents a double booking?

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

    Start the lab with Compose and confirm n8n opens and the mock calendar answers.

  2. Exercise 2medium

    Send the same approved event key twice to the mock calendar and show one booking.

  3. Exercise 3hard

    Add an authenticated approve step that rejects a call without the reviewer credential and expires after 30 minutes.

Check yourself

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

Feel confident about this topic?

Frequently asked questions

Do I need an OpenAI account?
Not for the core build. Transcript mode works with no model or voice provider. Real speech is an optional extra that may be paid.
Can I use a real calendar instead of the mock?
Better not for the capstone. The mock is safe to reset and lets you prove zero unintended bookings.
Where do I put the credentials?
In n8n credentials with placeholder values for the lab. Never write real secrets in workflow JSON or Git.

Go deeper

ShareXLinkedInWhatsApp