HUman in loop weired response

I am using the node Human in loop for slack with 2 button approve and disapprove. when anyone click on any button it redirect to new tab, But I want to stay in slack.

When using Human in the Loop in Slack with buttons (e.g., Approve / Disapprove), Slack sometimes opens a new browser tab when users click a button.
This happens when the button is configured with a url, which causes Slack to redirect.

:white_check_mark: Solution

To achieve this, you need to use Slack Block Kit buttons and configure Slack Interactivity to post back to an n8n Webhook.

:wrench: Step 1: Enable Interactivity in Slack

  1. Go to your Slack App at: Slack API: Applications | Slack
  2. Under Features → Interactivity & Shortcuts, enable Interactivity.
  3. Set the Request URL to point to a Webhook in n8n (see next step).

:wrench: Step 2: Create a Webhook in n8n

  1. In your n8n workflow, add a Webhook node.
  2. Configure it with:
  • HTTP Method: POST
  • Path: e.g., /slack-interaction
  1. Make sure the webhook is accessible publicly (use n8n.cloud or a tunnel in local dev).
  2. Copy the full webhook URL and paste it in the Slack Interactivity settings (Step 1).

:wrench: Step 3: Send Slack Message with Buttons (NO URLs!)

Use the Slack → Send Message node and set the blocks field (JSON mode):

{
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "Do you approve this request?"
      }
    },
    {
      "type": "actions",
      "elements": [
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text": "Approve"
          },
          "style": "primary",
          "value": "approve_action",
          "action_id": "approve_button"
        },
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text": "Disapprove"
          },
          "style": "danger",
          "value": "disapprove_action",
          "action_id": "disapprove_button"
        }
      ]
    }
  ]
}

:stop_sign: Important:
Do not use the url property inside the button — this causes Slack to open a new tab.
Use action_id and value instead.

:wrench: Step 4: Handle Button Response in Webhook

When a user clicks a button, Slack will send a payload to your webhook. Example:

{
  "payload": {
    "actions": [
      {
        "action_id": "approve_button",
        "value": "approve_action"
      }
    ],
    "user": {
      "id": "U123456"
    },
    ...
  }
}

:white_check_mark: Final Tips

  • Avoid using url on buttons if you want to stay in Slack.
  • Use action_id + value and connect Slack’s Interactivity feature to an n8n Webhook.
  • This allows approval flows to stay entirely within Slack without redirecting the user.
1 Like

Thanks! I will try this.
Responding here so this thread will not close