Overview
The "Lamatic Respond to Webhook" node is designed to send HTTP responses in workflows triggered by webhooks, specifically tailored for use with the Lamatic Webhook integration. It allows flexible response types such as JSON data, JWT tokens, text messages, binary files, redirects, or no data at all. This node is useful when you want to control exactly what data is sent back to the client that triggered the webhook, enabling scenarios like API responses, file downloads, authentication token issuance, or HTTP redirects.
Practical examples include:
- Returning a custom JSON payload after processing webhook data.
- Sending a signed JWT token as part of an authentication flow.
- Responding with a binary file (e.g., an image or document) received earlier in the workflow.
- Redirecting the client to another URL after webhook processing.
- Simply acknowledging receipt with a text message or empty response.
Properties
| Name | Meaning |
|---|---|
| Verify that the "Lamatic Webhook" node's "Respond" parameter is set to "Using Lamatic Respond to Webhook Node". More details | A notice reminding users to configure the corresponding Lamatic Webhook node properly to use this node effectively. |
| Respond With | The type of response to return. Options: - All Incoming Items: Respond with all input JSON items. - Binary File: Respond with incoming binary file data. - First Incoming Item: Respond with first JSON item. - JSON: Respond with custom JSON body. - JWT Token: Respond with a JWT token. - No Data: Respond with an empty body. - Redirect: Respond with an HTTP redirect. - Text: Respond with simple text message. |
| Credentials | Required API authentication credentials, shown only if "Respond With" is set to "JWT Token". |
| When using expressions, note that this node will only run for the first item in the input data | Informational notice shown when responding with JSON, text, or JWT, indicating that only the first input item is processed in these modes. |
| Redirect URL | The URL to redirect to, required if "Respond With" is set to "Redirect". Must be a valid URL. |
| Response Body (JSON) | Custom JSON data to respond with, used if "Respond With" is set to "JSON". |
| Payload | JSON object payload to include inside the JWT token, used if "Respond With" is set to "JWT Token". |
| Response Body (Text) | Text string to respond with, used if "Respond With" is set to "Text". |
| Response Data Source | For binary responses, choose how to select the binary data: - Choose Automatically From Input: Use if input contains a single binary data. - Specify Myself: Manually specify the input field name containing binary data. |
| Input Field Name | The name of the input field containing binary data, required if "Response Data Source" is set to "Specify Myself". |
| Options | Additional options: - Response Code: HTTP status code to return (default 200). - Response Headers: Add custom headers to the HTTP response. - Put Response in Field: Name of the field to put response data into (for JSON responses with multiple items). |
Output
The node outputs the same input items it receives, unchanged, allowing further workflow processing if needed.
The actual HTTP response sent back to the webhook caller depends on the selected "Respond With" option:
- All Incoming Items: Responds with an array of all input JSON items, optionally nested under a specified field.
- First Incoming Item: Responds with the first input JSON item, optionally nested under a specified field.
- JSON: Responds with a custom JSON object defined in the node parameters.
- JWT Token: Responds with a signed JWT token containing the specified payload.
- No Data: Responds with an empty body.
- Redirect: Responds with an HTTP redirect to the specified URL.
- Text: Responds with a plain text message.
- Binary File: Responds with binary data from the input item, either automatically detected or specified by input field name. Sets appropriate content-type and content-length headers.
If response headers are configured, they are included in the HTTP response. The HTTP status code can also be customized.
Dependencies
- Requires an API key credential for signing JWT tokens when "Respond With" is set to "JWT Token".
- Uses the
jsonwebtokenlibrary internally to create JWT tokens. - Relies on proper configuration of the Lamatic Webhook node in the workflow, which must have its "Respond" parameter set to "Using Lamatic Respond to Webhook Node".
- No other external services are directly called by this node.
Troubleshooting
Error: Insert a Webhook node to your workflow and set the “Respond” parameter to “Using Respond to Webhook Node”
This error occurs if the node is used without a preceding webhook node configured correctly. To fix, add a Lamatic Webhook node and set its "Respond" parameter accordingly.Invalid JSON in 'Response Body' field
When using the JSON response mode, ensure the JSON entered in the "Response Body" parameter is syntactically correct.No binary data exists on the first item!
When responding with binary data, the first input item must contain binary data. If not, check upstream nodes to ensure binary data is present.Error signing JWT token
Indicates issues with the provided credentials or payload when generating a JWT token. Verify the API key credential and payload format.Unsupported Response Data option
If an unsupported "Respond With" option is selected, the node will throw an error. Use one of the supported options listed in the properties.
Links and References
- n8n Respond to Webhook Node Documentation
- JSON Web Tokens (JWT) Introduction
- Lamatic Webhook Integration Guide (Assumed relevant external resource)