Lerty Trigger icon

Lerty Trigger

Triggers when receiving messages from Lerty agents

Overview

The Lerty Trigger node listens for incoming messages and events from Lerty agents via webhooks. It activates workflows when specific types of events occur, such as user messages, agent responses, or file attachments. This node is useful for automating processes based on real-time communication with Lerty agents, like logging conversations, triggering notifications, or processing attachments.

Practical examples:

  • Automatically log all user messages received by a particular Lerty agent into a database.
  • Trigger follow-up workflows when an agent sends a response.
  • Process and store file attachments sent through the Lerty platform.

Properties

Name Meaning
Agent Name or ID Select the Lerty agent to receive messages from. Choose from a list of agents or specify an ID via expression.
Event Types Select one or more event types that will trigger the node:
- Agent Response
- User Message
- File Attachment
Additional Fields Optional extra settings:
- Secret Token: A secret token used to authenticate incoming webhook requests.

Output

The node outputs JSON data representing the event received from the Lerty agent. The output JSON includes:

  • All original event data fields sent by Lerty.
  • agent_id: The selected agent's ID.
  • conversation_id: The conversation or thread identifier (supports multiple possible field names).
  • response_webhook: URL for sending responses back, if provided.

Additionally, HTTP headers from the webhook request are included alongside the JSON data.

If the event type does not match the selected triggers or authentication fails, the node responds with appropriate HTTP status codes but does not emit workflow data.

This node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the Lerty API.
  • Needs network access to receive webhook POST requests from Lerty.
  • The node dynamically loads available agents from the Lerty API to populate the "Agent Name or ID" dropdown.
  • Webhook URLs must be publicly accessible for Lerty to send events.

Troubleshooting

  • Unauthorized errors (HTTP 401):
    Occur if the incoming webhook request does not include the correct secret token in either the x-lerty-signature header or the authorization header. Ensure the secret token configured in the node matches what Lerty sends.

  • No events triggered:
    Verify that the selected event types include the types being sent by Lerty. If none match, the node filters out the event without triggering the workflow.

  • Failed to load agents:
    Happens if the API credentials are invalid or the Lerty API is unreachable. Check API key validity and network connectivity.

  • Webhook registration failures:
    Errors during webhook creation or deletion indicate issues with the Lerty API or credentials. Review error messages and ensure proper permissions.

  • Manual trigger error:
    This node only works with webhooks; attempting to run it manually will throw an error instructing to activate the workflow.

Links and References

  • n8n Expressions Documentation — For using expressions in property values.
  • Lerty API documentation (not linked here) — Consult your Lerty API docs for details on event types and webhook setup.

Discussion