Hi everyone
I’m trying to open a Slack modal using the views.open method triggered by a Slash Command (/enviar-credenciales) in an n8n workflow. The flow works perfectly when tested via cURL, but fails when triggered via n8n.
Workflow Setup
- Webhook Node
• Method: POST
• Receives the Slack Slash Command.
- Code Node
• Extracts trigger_id from body.trigger_id
• Builds the modal view with multiple inputs (language, email list, credentials, etc.).
- HTTP Request Node
• URL: https://slack.com/api/views.open
• Method: POST
• Headers:
{
"Authorization": "Bearer xoxb-...",
"Content-Type": "application/json"
}
• Body (as JSON with expressions):
{
"trigger_id": "={{ $json.trigger_id }}",
"view": {{ JSON.stringify($json.view) }}
}
- Respond to Webhook Node
• Sends a basic response like:
{
"text": "📤 Sending modal..."
}
Result
The HTTP Request node returns the following error:
{
"ok": false,
"error": "invalid_trigger_id"
}
Here’s the incoming trigger_id from the webhook payload:
"trigger_id": "8653186027153.716539322848.603f5d38c28b11be04d745b93a79edb4"
When using the exact same payload via cURL, the modal opens successfully.
My Question
Is there something in how n8n handles Slack webhook data that could cause the trigger_id to become invalid by the time the HTTP request is made?
Any examples of working Slack + views.open workflows in n8n that I can look at would be super helpful
Thanks in advance!