# n8n Workflows

{% hint style="warning" %}
**The existing "Mindee" node in n8n is for the legacy v1 version, it will not work for v2.**

Use the instructions below to integrate n8n.

We are working on [updating the Mindee n8n node](https://github.com/n8n-io/n8n/pull/18986).
{% endhint %}

## Use a Sample n8n Workflow

Use our provided sample n8n workflow file and use it as base for creating your own workflow.

You can also import into an existing workflow, the new nodes will simply be added.

### Import the Sample n8n Workflow

First step is to download our sample workflow file below:

{% file src="<https://4029869281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu5bStlX8nv4b9z4GXB2S%2Fuploads%2Fgit-blob-c7a256f102b6791410ad6fe353a9f3d7a1039767%2Fn8n_mindeev2-enqueue_and_poll.json?alt=media>" %}

Next, import it into a new or existing n8n workflow:

<figure><img src="https://4029869281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu5bStlX8nv4b9z4GXB2S%2Fuploads%2Fgit-blob-c738d5941f4ac1040a1cdd20465da3a45596c436%2Fn8n_import-workflow-file.png?alt=media" alt="importing the sample n8n workflow"><figcaption></figcaption></figure>

Once the file is imported the nodes and steps will show up.

### Configure the Authentication

Open the "Mindee V2 Post" node by double-clicking it, and create a Header Auth Credential:

<figure><img src="https://4029869281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu5bStlX8nv4b9z4GXB2S%2Fuploads%2Fgit-blob-52d9f29991bff5ce060cf4ab6e6e5593ad748781%2Fn8n_create-auth-credentials.png?alt=media" alt="adding mindee authentication in n8n"><figcaption></figcaption></figure>

When creating your Credential, first choose one of your [api-keys](https://docs.mindee.com/integrations/api-keys "mention").

Then, set the following values in the Credential dialog box:

| Name                       | Value                               |
| -------------------------- | ----------------------------------- |
| Credential Name (top left) | `Mindee v2 -` + your API key's name |
| Header Name                | `Authorization`                     |
| Header Value               | Your API key's value                |

It should look something like this when done:

<figure><img src="https://4029869281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu5bStlX8nv4b9z4GXB2S%2Fuploads%2Fgit-blob-2998e75e8d4328161335ef1ef82d1b72b77ad7b1%2Fn8n_auth-params.png?alt=media" alt="configuring mindee authentication in n8n"><figcaption></figcaption></figure>

Next, make sure the following n8n nodes are all using the Credential just created:

* "Mindee V2 GET Job"
* "Mindee V2 GET Inference"

It should be done automatically, but please open each node and make sure!

When all nodes are using the same Credential, authentication is set up correctly.

### Configure the Model ID

First copy your model's ID from the Mindee platform.

Open the "Mindee V2 Post" node, and scroll to the "Body Parameters" section.

Set the value of the "model\_id" parameter to your model's ID.

It should look something like this:

<figure><img src="https://4029869281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu5bStlX8nv4b9z4GXB2S%2Fuploads%2Fgit-blob-5a627d1c66e22c65bf33644199a814eaccfdd772%2Fn8n_model-id-param.png?alt=media" alt="mindee model configuration in n8n"><figcaption></figcaption></figure>

The workflow is now configured to use the specified model.

### Test the n8n Workflow

We've included a "HTTP Request" node that will download a sample invoice file from our Github repository.

In n8n, simply click the "Execute workflow" button and follow along as the various nodes/steps are executed.

In this way make sure the workflow is able to arrive at the "Result" step. The actual contents of the result don't matter, since the sample file is there only for testing the API connection. The sample file is not meant for testing your model.

Once you're able to get a result, change the "HTTP Request" node to something actually useful to you.

Some examples:

* use an IMAP trigger to process email attachments
* use a FTP trigger to process files on a FTP server

#### Something not working as expected?

Check the [problem-database](https://docs.mindee.com/integrations/problem-database "mention") section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mindee.com/integrations/no-code-integrations/n8n-workflows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
