# Connect Zapier and n8n

## Agent prompt

```text
Help me connect Slatebox to my Zapier or n8n automations. Ask which direction I need: create a slate from my flow, keep one slate current from my flow, hear from Slatebox when something changes, or run my workflows from a slate. Give me the exact request from the guide, with the token as a placeholder I fill in from Profile, Developer access, and set it up as an n8n HTTP Request node or a Zapier Custom Request step. Never ask me to paste a token or a hook secret into chat.

Read https://docs.slatebox.com/Using-Slatebox/zapier-and-n8n.md first. Ask for the inputs you need. Tell me what you verified and which steps I still need to do.

If your client cannot fetch the documentation, read the same published file at https://raw.githubusercontent.com/Slatebox/slatebox-docs/retype/Using-Slatebox/zapier-and-n8n.md.
```

Wire Slatebox into the automations your team already runs. Your flow creates slates or keeps one current, Slatebox tells your flow when something changes, and your n8n workflows and Zapier actions run from a slate with a person approving each. All of it is free.

| You want | Use |
| --- | --- |
| A new slate from a form, a ticket or meeting notes | [One HTTP request](#create-a-slate-from-your-flow) |
| One slate your flow keeps current, such as an incident board | [The Render from a webhook recipe](#send-data-in-with-a-signed-webhook) |
| Your flow to hear when a recipe runs or a decision is logged | [Outbound webhooks](#hear-back-from-slatebox) |
| Your workflows to run from a slate | [Invite n8n, Zapier or Make](#run-your-workflows-from-a-slate) |

There is no Slatebox app in Zapier's directory yet: use **Webhooks by Zapier** and **Code by Zapier** with the requests below. In n8n, use the **HTTP Request** node.

## Create a slate from your flow

Make a token in **Profile → Developer access** with **Create and edit slates** (`slates:write`). Send an outline, one item per line, indented for children, and get a mind map back:

<!-- tabs -->

```sh curl
curl -X POST "https://app.slatebox.com/api/v1/slates/mermaid" \
  -H "Authorization: Bearer $SLATEBOX_API_TOKEN" -H 'Content-Type: application/json' \
  -d '{"name":"Kickoff with Acme","outline":"Kickoff with Acme\n  Goals\n    Launch by March\n  Risks\n    SSO setup"}'
```

<!-- /tabs -->

The answer holds the new slate's `url`, to post to Slack or email in the next step. Send `mermaid` instead of `outline` for a flowchart or a Gantt chart. Add `projectId` to put the slate in a project.

| Tool | Set up |
| --- | --- |
| n8n | **HTTP Request** node: Method `POST`, the URL above, Authentication **Generic Credential Type → Header Auth** with name `Authorization` and value `Bearer <token>`, Body **JSON** |
| Zapier | **Webhooks by Zapier → Custom Request**: Method `POST`, the URL above, Data as the JSON body, Headers `Authorization: Bearer <token>` and `Content-Type: application/json` |

## Send data in with a signed webhook

To keep one slate current from each post, rather than make a new one each time:

1. In a project, **Recipes → Add a recipe → Render from a webhook**, then **Turn on**.
2. On its **Webhooks** tab, add an inbound hook. Copy its address and its secret (`whsec_…`); the secret is shown once.
3. Post a graph, Mermaid, a board or text, with a `key`. Each post with the same key updates the same slate, and a card a person moved or renamed stays theirs.

Sign each body with the secret: `Slatebox-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + body)>`. In n8n compute it with the **Crypto** node or a **Code** node; in Zapier, with **Code by Zapier**. The same request from a shell:

<!-- tabs -->

```sh curl
BODY='{"reason":"build 812","data":{"key":"deps","graph":{"nodes":[{"key":"web","label":"web"},{"key":"api","label":"api"}],"edges":[{"from":"web","to":"api"}]}}}'
T=$(date +%s)
SIG=$(printf '%s.%s' "$T" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/.* //')
curl -X POST "$HOOK_URL" -H 'Content-Type: application/json' \
  -H "Slatebox-Signature: t=$T,v1=$SIG" -H "Slatebox-Delivery: build-812" -d "$BODY"
```

<!-- /tabs -->

You get `202` with a `runId`. A signature more than five minutes old is refused, a repeated `Slatebox-Delivery` runs once, and a body can be up to 256 KB.

No signing step? Send the same `{ reason, data }` to `POST /api/v1/recipes/{instanceId}/run` with a token that has **Run and preview recipes, with my data** (`recipes:run`).

## Hear back from Slatebox

On a recipe's **Webhooks** tab, add an outbound hook with your flow's address: an n8n **Webhook** node's production URL, or a **Catch Hook** from Webhooks by Zapier. Pick the events, or leave the list empty for all.

| Event | Sent when |
| --- | --- |
| `run.finished`, `run.failed` | A recipe run ends |
| `slate.updated` | A slate the recipe keeps changed; `data.url` is its link |
| `approval.needed` | A change outside Slatebox waits for someone's **Approve** |
| `decision.recorded`, `decision.reversed` | The Slack decision log logged or reversed a decision |
| `timeline.slipped` | A commitment's date moved later |
| `architecture.new_dependency` | The architecture recipe found a new dependency |

Each delivery is signed the same way and carries `Slatebox-Delivery`: dedupe on it, because a failed delivery is retried. Answer `410 Gone` to turn the hook off.

## Run your workflows from a slate

Invite an automation tool onto a slate with **+ Invite agent**, then ask it by `@name`. Each action it proposes waits on a card with **Approve** and **Decline**.

| Tool | Connect |
| --- | --- |
| n8n | In n8n, add an **MCP Server Trigger** to a workflow, attach the workflows it may run, set its authentication to **Bearer auth**, and copy its production URL. In Slatebox, choose the **n8n** card, paste the URL, then the token |
| Zapier | Choose the **Zapier** card and sign in to Zapier |
| Make | Choose the **Make** card and sign in to Make |

Then ask “@n8n run the postmortem workflow for these action items”. [Invite an outside agent](invite-agents.md)

## Questions

### How do I connect n8n to Slatebox?

Three ways, all free. Create slates with an **HTTP Request** node to `POST /api/v1/slates/mermaid`. Keep a slate current by posting to a **Render from a webhook** recipe's signed hook. Run your workflows from a slate by inviting n8n with your **MCP Server Trigger**'s address.

### Is there a Slatebox Zapier integration?

Use **Webhooks by Zapier** to call Slatebox's API, and a **Catch Hook** to hear Slatebox's webhooks. To run Zapier actions from a slate, invite the **Zapier** agent with **+ Invite agent**. There is no Slatebox app in Zapier's directory yet.

### Can my flow change a slate people are editing?

Yes. A post to the webhook recipe updates the slate by key, and the notes people moved, renamed or deleted stay as they left them.

### Does it work on a self-hosted Slatebox?

Yes. Use your own Slatebox's address instead of `https://app.slatebox.com`. An admin turns recipes on in **Admin › Recipes** first.
