# n8n workflow recipes

Proven workflow shapes for the most common form2wf jobs. Node settings and expressions are given so you can rebuild each in a few minutes.

## Contact form → email

workflow:

```
Webhook (POST /contact, Header Auth)  →  Send Email
```

| Node | Setting |
| --- | --- |
| Webhook | Respond: _Immediately_. Authentication: _Header Auth_ matching your form's header. |
| Send Email | To: your inbox. Reply-To: `{{ $json.body.data.email }}`. Subject: `New message from {{ $json.body.data.name }}`. Text: `{{ $json.body.data.message }}` |

## Lead capture → Google Sheets + Slack

workflow:

```
Webhook  →  Google Sheets (Append row)  →  Slack (Send message)
```

Map columns from `$json.body.data.*` and record `$json.body.metadata.timestamp` and `$json.body.metadata.origin` so you know which site each lead came from. Add a _hidden_ field with `{{params.utm_source}}` to capture campaigns.

## Pre-fill a form from a database

workflow:

```
Webhook (Respond: using Respond to Webhook)  →  Postgres / MySQL (Select)  →  Respond to Webhook (JSON)
```

Query with `{{ $json.body.params.id }}` (URL parameter) or, on protected forms, `{{ $json.body.endUser.email }}`. Respond with:

Respond to Webhook → Response Body:

```
{{ { "data": { "user": $json } } }}
```

Form fields then use `{{data.user.name}}` as their `defaultValue`.

## Customer admin (list / edit / delete)

The n8n side of the [customer admin example](https://form2wf.com/docs/data-pages#example):

| Workflow | Nodes | Notes |
| --- | --- | --- |
| list-customers (onload) | Webhook → Select rows → Aggregate → Respond to Webhook | Respond with `{ "data": { "customers": [...] } }`. Use an _Aggregate_ node to collect rows into one array. |
| update-customer (submit) | Webhook → Update row → Respond | Values at `$json.body.data.id / name / email`. |
| delete-customer (row action) | Webhook → Delete row → Respond | Id from the query: `{{ $json.query.id }}`; the row itself is the body. |

## File upload → cloud storage

workflow:

```
Webhook (Binary property: resume)  →  Google Drive / S3 (Upload)  →  Send Email
```

Multipart submissions put text fields at `$json.body.<name>` and the file in the binary property named after the field. Parse `$json.body._metadata` with `JSON.parse` if you need the timestamp or origin.

## Support request → AI triage

workflow:

```
Webhook  →  AI Agent / LLM (classify)  →  Switch (by category)  →  Create ticket / Email / Slack
```

Pass `$json.body.data.message` to the model and ask for a category and urgency. On a login-protected form, include `$json.body.endUser.email` so the ticket is tied to a verified customer.

## An n8n AI agent that manages your forms

n8n's **MCP Client Tool** node can connect an AI Agent to the form2wf MCP server — for example a scheduled agent that reviews yesterday's failed submissions and reports them. Settings:

| Field | Value |
| --- | --- |
| Endpoint | `https://form2wf.com/mcp` |
| Server Transport | HTTP Streamable |
| Authentication | Header Auth — name `Authorization`, value `Bearer f2w_…` |
| Tools to include | Selected — e.g. `list_forms`, `list_submissions` (use a viewer key) |

## Making workflows idempotent

Because failed deliveries are retried, build a dedupe key from the submission and skip repeats:

Code node — dedupe key:

```
const b = $json.body;
return [{ json: { ...b, dedupeKey: `${b.endpointId}:${b.metadata.timestamp}:${b.data.email ?? ''}` } }];
```

Then use _Remove Duplicates_ (across executions) or an upsert on that key before sending emails or creating records.

---
Source: https://form2wf.com/docs/n8n-recipes — Form2Workflow documentation (n8n)
