# Let an AI agent send requests from n8n

Example: an onboarding assistant in n8n that has the Formstep node as a tool, so it can send a client a prefilled form, check how the request is going, and remind them.

The agent decides when to ask someone and what to fill in; Formstep collects the answers and checks them against the form. Checked on self-hosted n8n 2.44 with version 0.13.0 of the node, by running each tool from n8n’s tool test. **Output**, in step 3, came with version 0.15.0. The conversation itself depends on the model you connect.

![The workflow: When chat message received into the Onboarding assistant agent, with Claude as its chat model, Simple Memory as its memory, and three Formstep tools: Send the onboarding form, Check an onboarding and Remind the client](https://formstep.io/docs/guides/n8n/n8n-agent-workflow.png)

## Before you start

- The Formstep node and a [Formstep credential](https://formstep.io/docs/guides/n8n/connect/). n8n 2.46 lists the node as a tool without further setup. If it does not show up as a tool on an older self-hosted n8n, start n8n with `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true`.
- A credential for a chat model in n8n.
- A form. In Formstep, open **Templates**, pick **Client Onboarding**, click **Use template** and publish it. It asks the client to check their details and sign, and has a hidden field `customer_id`.

Import the workflow from

[formstep-ai-agent-onboarding.json](https://github.com/formstep/n8n-nodes-formstep/blob/main/examples/formstep-ai-agent-onboarding.json)

with **Import from File**, then pick your credentials and your form.

## 1. Set up the agent

Add a **When chat message received** trigger and an **AI Agent** node. Connect your chat model and a **Simple Memory**, so the agent remembers the request it sent earlier in the chat. Under **Options** › **System Message**, tell it what it is for and where to stop:

```text
You help the Acme Inc team onboard new clients.
To onboard a client, send them the onboarding form with what you already know: their name, email, company and customer number. Ask the team member for anything missing first, and never invent an email address.
After sending, give the team member the link and the request id.
When asked how an onboarding is going, check the request. A completed request has the answers the client confirmed.
Remind a client only when the team member asks you to.
```

## 2. Add a tool that sends the form

Click **+** under the agent’s **Tool** input, search for **Formstep** and pick **Create request**. Name the tool after what it does, here _Send the onboarding form_, and set **Tool Description** to **Set Manually** with a sentence the model reads to decide when to use it.

![The Send the onboarding form tool: its description, Resource Request, Operation Create, Form Source Published Form, Form Client Onboarding, Recipient Email and Values to Send customer\_id, Full Name and Company each filled by $fromAI with a key and a description](https://formstep.io/docs/guides/n8n/n8n-agent-tool.png)

Pick the form yourself, so the agent can only send this one. For each value the agent should fill, click the ✨ button next to the parameter, or write `$fromAI()` with a key and a description the model reads:

```text
Recipient Email   {{ $fromAI('email', 'The client email address, exactly as the team member gave it', 'string') }}
customer_id       {{ $fromAI('customer_id', 'The customer number, such as C-1042', 'string') }}
Full Name         {{ $fromAI('full_name', 'The client contact full name', 'string') }}
Company           {{ $fromAI('company_name', 'The client company name', 'string') }}
```

- Use each key once per tool. Two parameters with the same key get the same value.

- Leave out what the client should type themselves, or what the agent cannot know. They fill in the rest of the form.

- Under **Additional Fields**, **Delivery** _Email the Invitation_ emails the client. **Test Mode**, on in the example, sends nothing while you try it out.

## 3. Add tools to check and remind

Add two more Formstep tools on the same input:

- _Check an onboarding_: **Get request**, with **Request** › **By ID** set to `{{ $fromAI('request_id', 'The id that Send the onboarding form returned for this client', 'string') }}`. **Output** **Simplified**, the default, returns ten fields: the status, the outcome, the client’s email, the dates, and the answers once the client completed the form. That keeps the model’s context small. For even less, set it to **Selected Fields** and pick what the agent needs, like **Status** and **Answers**: the tool returns those and the request ID. **Raw** returns the whole request.

- _Remind the client_: **Remind request recipient**, with the same **Request**. A test request is never reminded, so this tool answers with an error until Test Mode is off.

A new Remind or Cancel tool returns the simplified request unless you set **Output** to **Raw** or **Selected Fields**. New tools are version 5 of the node. Tools saved with version 3 or 4 keep **Simplify** on Get request and return the whole request from Remind and Cancel. See [Read a request with Get request](https://formstep.io/docs/guides/n8n/manage-requests/#get-a-request).

## 4. Test each tool without the model

Open a tool and click **Execute step**. n8n asks for the values the model would send, one box per `$fromAI` key, then runs the tool. _Send the onboarding form_ returns the request’s `id` and `url`; put that `id` into _Check an onboarding_ to see what the agent will read. When a value is refused, the error the agent gets names it, such as _VALIDATION\_ERROR: “email” is not a valid email address_, so the model can ask again.

## 5. Chat with it

Click **Open chat** and write, for example: _Onboard Analytical Engines Ltd, contact Ada Lovelace, <ada@example.com>, customer number C-1042._ The agent calls _Send the onboarding form_ and replies with the link. Later, _How is the Ada Lovelace onboarding going?_ makes it call _Check an onboarding_ with the request ID it kept in memory.

> **Hear back without asking**
>
> The agent only knows what it checks. To act the moment a client completes the form, add a separate workflow with a [Formstep Trigger on Request Completed](https://formstep.io/docs/guides/n8n/send-a-request/#trigger) for the same form, and post the answers to your team or your CRM from there.

- The tools reach only the workspace the credential connects, and only the forms you picked in them.

- Agents outside n8n, like Claude or ChatGPT, can do the same through Formstep’s MCP server; see [Send a request with an AI agent](https://formstep.io/docs/guides/ai-agents/send-a-request/).

## Next steps

[Start a workflow from the trigger](https://formstep.io/docs/guides/n8n/send-a-request/#trigger) — Start a workflow when the client completes the form

[Look up, remind and cancel requests in n8n](https://formstep.io/docs/guides/n8n/manage-requests/) — Every request action, outside an agent
