Table of Contents

How to Integrate Landbot with n8n using Webhooks

Pau Sanchez Updated by Pau Sanchez

This guide walks you through connecting Landbot with n8n using webhooks, enabling you to automate workflows and pass data between the two platforms seamlessly.

Overview

Webhooks allow Landbot to send data to n8n in real-time, triggering automated workflows based on user interactions in your chatbot. This integration is perfect for capturing leads, processing form submissions, or triggering complex automation sequences.

Prerequisites
  • An active n8n account (cloud or self-hosted)
  • A Landbot account with webhook capabilities
  • Basic understanding of JSON data structure

Part 1: Setting Up n8n

Step 1: Configure the Webhook Trigger

First, you'll need to create a webhook endpoint in n8n that Landbot can send data to.

  1. Create a new workflow in n8n
  2. Add a Webhook node to your workflow:
    • Click the "+" button to add a new node
    • Search for "Webhook" and select the Webhook Trigger node
  3. Configure the Webhook node:
    • HTTP Method: Select POST
    • Path: Enter a custom path (e.g., /landbot-webhook) or leave default
    • Authentication: Set to None (or configure as needed for your security requirements)
    • Respond: Set to Using 'Respond to Webhook' Node
  4. Copy the Webhook URLs:
    • Test URL: Use this for initial testing
    • Production URL: Use this in your live Landbot flow

Important: The Test URL is temporary and only works while your workflow is actively open in n8n. Always switch to the Production URL before deploying your bot.
Step 2: Add and Configure the 'Respond to Webhook' node

Configure how n8n responds to Landbot's webhook request.

  1. Add a 'Respond to Webhook' node after your Webhook trigger

  1. In the 'Respond to Webhook' node configure the settings:
    • Respond With: Select JSON
    • Response Body: Leave as is the example, or edit with params you want to send back to Landbot
  2. (Optional) Add processing nodes:
    • After the Webhook trigger, add any nodes you need for processing (e.g., Set, Function, HTTP Request)
    • These will execute before the response is sent with the 'Respond to Webhook' node
  3. Save and activate your workflow
  4. Copy the Production URL for use in Landbot

Part 2: Configuring Landbot

Step 3: Set Up the Webhook Block

Now you'll configure Landbot to send data to your n8n webhook.

  1. Add a Webhook block to your Landbot flow:
    • Open your bot in the Landbot builder
    • Add a new block by clicking the "+" button
    • Select Integrations β†’ Webhook
  2. Configure the Webhook URL:
    • URL: Paste your n8n Production URL (not the Test URL)
    • If testing first, you can temporarily use the Test URL, but remember to update it before going live
  3. Set the HTTP Method:
    • Select POST from the dropdown
  4. Configure the JSON Body:
    • Click on Body section
    • Select JSON format
    • Structure your JSON payload with the data you want to send
    Example JSON structure:
    {
    "name": "@name",
    "email": "@email",
    "phone": "@phone",
    "message": "@message"
    }

    Tip: Use Landbot variables (prefixed with @) to dynamically insert user responses

  1. Add Test Values:
    • Fill in sample data for each field to test the connection
    • Example test values:
      • Name: "John Doe"
      • Email: "john@example.com"
      • Phone: "+1234567890"
      • Message: "Test message"
  2. Test the Connection:
    • Click the Test the request button
    • Wait for a successful response (status 200)
    • Verify in n8n that the webhook received the test data
  3. Map Response Values to Fields (Optional):
    • If n8n sends data back in the response, you can map it to Landbot variables
    • In the Response Mapping section, map JSON response fields to Landbot variables
    • Example: Map myField to @myfield
  4. Save your configuration by clicking on "APPLY"

Testing Your Integration

  1. In n8n:
    • Ensure your workflow is activated (toggle in the top-right corner)
    • Open the Executions tab to monitor incoming webhooks
  2. In Landbot:
    • Use the Preview feature to test your bot
    • Complete the flow up to the webhook block
    • Check that data appears correctly in n8n executions
  3. Verify Data Flow:
    • Confirm all fields are mapping correctly
    • Check that any response data from n8n is properly captured in Landbot
    • Test edge cases (empty fields, special characters, etc.)

Troubleshooting

Webhook not receiving data:

  • Ensure the n8n workflow is activated
  • Verify you're using the Production URL, not the Test URL
  • Check that the HTTP method is set to POST in both platforms

Data not mapping correctly:

  • Verify your JSON structure syntax
  • Ensure Landbot variables (e.g., @email) are spelled correctly
  • Check that variable names match between platforms

Timeout errors:

  • If your n8n workflow takes too long to process, consider setting Response Mode to "On Received"
  • Optimize your n8n workflow to process faster
  • Increase timeout settings in Landbot if available
Best Practices
  • Always use Production URLs in your live Landbot flows
  • Validate user input before sending to n8n to ensure data quality
  • Handle errors gracefully in both platforms with appropriate fallback messages
  • Test thoroughly before deploying to production
  • Monitor your n8n executions regularly to catch any issues early
  • Document your webhook payload structure for future reference
Next Steps

Once your integration is working, consider:

  • Adding data validation or transformation in n8n
  • Connecting n8n to other services (CRM, email, databases)
  • Setting up error notifications for failed webhook calls
  • Creating conditional workflows based on webhook data
Additional Resources

Need help? Contact our support team or visit our community forums for assistance.

Was this article helpful?

Contact