Skip to main content

Using n8n with FahemAI

n8n is an open-source workflow automation platform that allows you to create, schedule, and execute various automated tasks.

FahemAI currently supports triggering workflows and receiving responses through the Webhook node in n8n workflows.

Using n8n as the runner

To integrate n8n, open your pipeline configuration and select n8n Workflow API as the runner in the AI settings.

Then, configure the connection settings as described below.

Configuring n8n Workflow Connection

You can set up the connection using either a Webhook or an On chat message trigger in n8n.

Trigger Configuration

  • Webhook: Use the standard Webhook node to receive data.
  • On chat message: Use the specific chat trigger if building conversational flows.

Streaming Responses

If you require streaming responses (generating text token by token), ensure you set the Response Mode to Streaming in your n8n node configuration.

Authentication

Ensure the authentication method set in n8n matches the one configured in FahemAI's pipeline settings. You can modify this as needed for security.

AI Agent Configuration

When configuring the node that calls the AI model (as AI Agent):

  • For streaming responses, ensure you enable the streaming options in the node settings.
  • If streaming is not required, you can leave these options disabled.

Response Configuration

To send the final response back to FahemAI:

  1. Use the Respond to Webhook node in n8n.
  2. Ensure the Response Body key matches the output key name defined in your FahemAI pipeline configuration.
tip

If you are using streaming responses directly from the AI Agent node, the "Respond to Webhook" node might not be necessary.

After completing the configuration, remember to click Active at the top of your n8n canvas to enable the workflow.