# Connect Formstep to n8n

Connect n8n to one Formstep workspace with an API key, or on self-hosted n8n by signing in with OAuth2, and check that your forms show up.

## Before you start

- The Formstep node installed on your n8n. See [Install the Formstep node in n8n](https://formstep.io/docs/guides/n8n/install-the-node/), which also covers what your n8n needs first.
- A Formstep account that is a member of the workspace you want to connect.
- At least one published form in that workspace.

## Choose how to connect

Each Formstep node has an **Authentication** choice:

- **API Key**, the default, works on n8n Cloud and on self-hosted n8n. You copy a key from Formstep and paste it into n8n.

- **OAuth2** works on self-hosted n8n only. You sign in to Formstep from n8n instead of copying a key. Nodes added before version 0.14.0 of the node use it, and keep using it.

## Connect with an API key

1. In Formstep, open **OAuth and API Keys** in the workspace n8n should use. Click **Create token** and name it after your n8n, for example _n8n_. Under **Expiration**, pick **No expiration**, then click **Create token**.

2. Copy the key. Formstep shows it only once; it starts with `fs_`.

3. In n8n, add a Formstep node to a workflow, open **Credential** and click **Create new credential**. n8n opens a **Formstep API** credential.

4. Paste the key into **API Key** and click **Save**. n8n checks the key with Formstep and saves the credential.

> **Pick No expiration**
>
> A key created with 30 or 90 days stops working on that date, and every workflow that uses it stops with an `UNAUTHORIZED` error. With No expiration, the key works until you delete it. To replace a key, create a new one, paste it into the same credential in n8n and save.

## Connect with OAuth2 (self-hosted n8n)

In the Formstep node, set **Authentication** to **OAuth2**, open **Credential** and click **Create new credential**. You can also start from **Overview** › **Credentials** › **Create** and search for **Formstep OAuth2 API**.

![The Formstep OAuth2 API credential: a Connect button, the OAuth Redirect URL https://n8n.example.com/rest/oauth2-credential/callback, and Allowed HTTP Request Domains set to All](https://formstep.io/docs/guides/n8n/n8n-credential-connect.png)

There is nothing to fill in. n8n registers itself with Formstep when you click **Connect**, including the **OAuth Redirect URL** shown here. The note below that URL asks you to enter it in Formstep; you can ignore it, because Formstep has no place to paste it.

Click **Connect**. n8n opens a Formstep window. If you are not signed in to Formstep in this browser, sign in first. Formstep then shows what n8n may do and asks which workspace to connect:

![Formstep's Authorize access screen: n8n wants to connect to your Formstep workspace from n8n.example.com, with a list of permissions, a workspace picker set to Acme Inc, and Deny and Authorize buttons](https://formstep.io/docs/guides/n8n/formstep-authorize.png)

The connection reaches only the workspace you pick here.

Choose the workspace under **Workspace** and click **Authorize**. The window reports that the connection succeeded, and the credential in n8n shows as connected. Save it. The connection refreshes itself while a workflow uses it at least once every 30 days.

> **One credential, one workspace**
>
> To use a second workspace, create a second credential: a key from that workspace, or another OAuth2 sign-in with the other workspace picked. Rename each credential after the workspace it reaches. Each Formstep node then uses the credential you choose in it.

## Check the connection

Add a **Formstep Trigger** and pick the credential. **Form** lists the forms of the connected workspace, and you can search it by name; to paste a form’s ID instead, switch to **By ID**. A form marked _(not published)_ sends no events and takes no requests until you publish it.

![The Formstep Trigger with Credential Formstep account and Form set to From list, open on a search box above \[Guide\] Supplier onboarding and Approval](https://formstep.io/docs/guides/n8n/n8n-choose-form.png)

Forms from other workspaces never show here. A trigger saved before version 0.15.0 keeps a plain dropdown, Form Name or ID.

## Disconnect

In n8n, delete the credential under **Overview** › **Credentials**. Workflows that use it stop until you pick another credential in each Formstep node.

Deleting it in n8n does not end n8n’s access on the Formstep side. In Formstep, open **OAuth and API Keys**. For an API key, click the bin icon next to the key under **API Keys**. For OAuth2, click the bin icon next to n8n under **Connected apps** and confirm with **Disconnect**.

## Next steps

[Start an n8n workflow from public link submissions](https://formstep.io/docs/guides/n8n/public-link-submissions/) — Run a workflow when someone submits, edits or abandons a form

[Send a request and act on its outcome](https://formstep.io/docs/guides/n8n/send-a-request/) — Create a request, then branch on what the recipient decided
