Help: AI Agent using webhook trigger

Instead of chat trigger I want to use a webhook for the chatting. I want to have it via api call whether the user replying or the ai is replying. Is it possible? Do you have some sample template for me to study?

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:

Hello @felimarsalon ,

Thanks for sharing your use-case with us here in the n8n community.

Reading your comment, I believe the following examples may help you with your use-case:

Both are about using webhook with chat agents(google and liveagent ones).

If I understood your use-case correctly, you could link your webhook to an API call to an AI and return the response. In a high level, something like:

  • Webhook - Capture the chat message.
  • Decision - Decide whether the message is from the user or from the AI.
  • API Call - If it’s from the user, pass the message to AI for processing (using a third-party service like OpenAI).
  • Response - Return the AI-generated reply back to the chat system.

Let us know if that helps. Happy n8n integration!

Flavio

1 Like

Thank you! This will be very helpful. Since AI is trending, I’m currently building with AI agents. Many tutorials I’ve watched use chat triggers, but I can’t find any that use webhooks.