How to Combine Chat Trigger and Form Trigger Workflows?

I have an idea: in a Chat Trigger workflow (A), I want to switch to a Form Trigger workflow (B) as needed. After the Form Trigger workflow (B) completes (when the user clicks the submit button), I’d like to return to the Chat Trigger workflow (A) and continue the previous chat session.

The overall process looks like this:

AI: I’m the recruitment assistant for XXX company. How can I help you today?
User: I’m looking for a job as a driver.
AI: May I know your name?
User: My name is Kevin.
AI: Hi, Kevin! Welcome. I found this position for you. Please click the link below and fill out the form to provide some details. After that, we’ll continue the chat. Thanks for your cooperation!
----> Form Link <----
---------------------- User fills out the form and submits it ------------------------
AI: Kevin, thank you for submitting the form. I noticed from your submission that you’ve had some driving violations. Could you elaborate on this?
User: Sure…
AI: Understood. Thanks for clarifying.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hey @ichat006

Looks like a great workflow! Have you tried tinkering with n8n and see if it’s possible to implement? Our docs on AI are a great way to start :muscle:

Hi @ichat006

This is a great example of Human-in-the-loop and something that we’re working on currently :slight_smile:

As of now, you could only instruct the Agent to provide the link to the survey but it wouldn’t wait for the submission.
If you set up memory management to the agent you could probably have the user tell the agent that they’ve submitted the form and the agent could then use another tool to retrieve the execution data (Use the n8n API for that in another workflow and have the Agent call that workflow). You’d need to make sure to use an identifier in both workflows so the agent can retrieve the correct execution data.
The conversation could then continue from there once it’s gotten the data.

Haven’t tested this… So would be curious to know if it works for you. :slight_smile:

@ria @gualter
Thank you for your help.
My initial idea was that, during a conversation with AI, it might be more suitable to provide some information through a form. However, the key is that the chat should not be interrupted, so that the AI can gather information from the submitted form to continue the next round of the conversation.

I’m also looking for that feature, slightly different use case; mine currently would be:

  1. Form Workflow
  • Collect user information with a Form Trigger.
  • Store the input in a key-value storage node (telepilotco/n8n-nodes-kv-storage).
  • Redirect the user to the chat window.
  1. Chat Workflow
  • On first message, retrieve and clear the stored values. This allows the chat to use data submitted via the form.

My issues / Caveats:

  • The form workflow remains in a “Waiting” state even after redirection.
  • Timeout settings don’t clear that waiting state.
  • Managing multiple users/multiple submissions requires careful TTL handling in KV storage.
  • I see no way to do the chat interruptions besides session management (also not ideal due to lost or need to recreate chat-history in the window)