Create workflows using webhooks

Who can use this feature?
  • All members (by default)
  • StandardPlus, and Enterprise Grid plans

Workflow Builder makes it possible to automate routine processes and tasks right in Slack. To start a workflow from another service and bring information into Slack using Workflow Builder, create a workflow using a webhook.

What you'll need to get started

  • Familiarity with sending HTTP requests using the command line or another tool.
  • An understanding of incoming webhooks. For guidance, read the documentation on Slack API, or work with a developer on your team.

Configure a webhook workflow

Create a workflow

Workflows in Slack start in response to a trigger. Members can launch workflows from the  Shortcuts menu in a channel at any time. Other workflows can launch in response to an action a member takes (like joining a channel) or an event (like a webhook bringing information from another service into Slack). For example, you might set up a workflow that posts a message in your Customer Support team channel any time someone submits a ticket.

Tip: For step-by-step instructions to create a workflow, visit Automate everyday tasks with Workflow Builder.

Get your webhook request URL

Slack will generate a unique request URL for a webhook workflow once it's published. Request URLs start with and are followed by a secure, randomized string of characters.

Be sure to keep your request URL secure, as anyone with the link will have the ability to trigger your workflows.

Note: Webhook workflows are limited to one request per second. Learn more about rate limits on the Slack API site.

Add custom variables

Depending on your workflow, you can add up to 20 variables to pass data into Slack from another service or include Slack-specific information (like display names or email addresses) in messages your workflow posts.

For a workflow that posts a message each time a customer submits a support ticket, you may want the message to include a link to the support ticket and the assigned support agent's name. To create custom variables, you can add key value pairs in Workflow Builder as a text-based variable. Then, preview the JSON output to make sure the values match up with the other service you've connected to Slack.

Modal in the Slack desktop app where you can add custom variables for webhook workflows

If you were to add variables for support ticket links and assigned support agents, the JSON output would look like this: 

"support_ticket_link": "Example text",
"assigned_support_agent": "U123456789"

Tip: You can use any variables you create when adding steps to your workflow.

Publish and test your workflow

Before running your workflow in a public channel, you can select a test channel or your personal direct message for the first step in your workflow to make sure everything is working properly. To publish changes and test your workflow, follow the steps below: 

  1. From your desktop, click your workspace name in the top left.
  2. Select Tools, then Workflow Builder from the menu.
  3. Click Your Workflows in the top left. 
  4. Select your workflow from the list, then click Publish in the top right. 
  5. Once your workflow is live, send a post to your workflow's request URL using whatever tool you wish.

Once you've confirmed your workflow launches as expected, go back to Workflow Builder to update the first step of your workflow to post in the right channel or DM. Then, publish the changes. 

Regenerate a webhook URL

If a webhook's URL gets exposed or needs to be changed for any reason, follow the steps below: 

  1. From your desktop, click your workspace name in the top left.
  2. Select Tools, then Workflow Builder from the menu.
  3. Click Your Workflows in the top left. Select a workflow from the list. 
  4. Next to Webhook, click Edit
  5. Select Regenerate URL, then click the Copy button to copy the new URL to your clipboard. 
  6. Click Save

Note: When you regenerate a webhook URL, the connection between your workflow in Slack and another service will break. Update the other service with your new URL to keep things running smoothly.

Tip: For more details on managing workflows, like adding collaborators or making changes to steps, visit Manage workflows you collaborate on.