Slack workflow steps for Background Agents
A Slack workflow can start a background agent as one of its steps. For example, someone fills in a "Request access" form, the next step runs the agent with their answers, and a later step emails the agent's answer to the requester.
Each agent's Slack app can offer two kinds of steps in Workflow Builder:
- The default step. Willow adds a ready-made Run agent name step when you turn workflow steps on. It takes a request, the person it acts for, and an optional channel. There is nothing to set up in Willow.
- Custom steps. You build them in the Slack app's settings with the inputs and outputs you need, then set in Willow how the agent runs each one.
Slack workflow steps are in beta. Ask your Willow contact to enable them for your organization. Until then, the Slack workflow steps section is hidden from the agent's Triggers tab.
Before you start
- The agent has its own Slack app, and it is Connected. See Set up Slack for background agents.
- Your Slack workspace is on a paid Slack plan. Slack only offers custom workflow steps on paid plans.
- You can reinstall the agent's Slack app, or you know who approves app installs in your workspace.
Slack requires apps with workflow steps to be org-ready. Org-ready means the app can be installed across your whole Slack organization, and your Slack admins can manage it in the Slack admin dashboard. Slack can't turn this off again, so the app stays org-ready even if you stop using workflow steps.
Turn on workflow steps for an agent
Workflow steps are off for every agent until you turn them on. Each agent is turned on separately.
- Open the agent and select the Triggers tab.
- In Slack workflow steps, select Turn on workflow steps.
- Read the summary and select Turn on. Willow updates the agent's Slack app: it adds the default step and makes the app org-ready.
- Select Reinstall in the banner that appears, and approve the install in Slack.
Slack only shows an app's steps in Workflow Builder after the app is reinstalled. The Reinstall the Slack app to finish banner stays until it is.
If your workspace needs an admin to approve installs, reinstall the app from Slack instead. Then open the agent's Settings tab and use Reinstalled from Slack? Paste the bot token to connect the new install.
If Willow couldn't update the app, the section shows The "Run agent" step isn't in the Slack app yet. Select Update Slack app to try again.
Use the default step
The default step is named Run agent name. Add it to a workflow in Slack Workflow Builder like any other step, and fill in its inputs. You can insert answers from earlier steps, such as form fields, as variables.
| Input | Required | What it does |
|---|---|---|
| Request | Yes | What the agent should do. Insert form answers as variables. |
| Requested by | Yes | The person the agent acts for, usually whoever submitted the form. Tools set to act on behalf of the triggering user run as this person. |
| Reply in channel | No | Where the agent's thread goes. Leave it empty to reply in a DM to the requester. |
When the step runs, the agent posts a message that starts a thread, quoting the request, and replies in that thread just as it does when someone @mentions it. The workflow continues right away, and later steps can use these outputs:
| Output | What it holds |
|---|---|
| Channel | The channel of the agent's thread. |
| Thread timestamp | The timestamp of the message that starts the thread. |
| Thread link | A link to the agent's thread. |
The default step doesn't pass on the agent's answer. To use the answer in a later step, build a custom step and choose When the agent answers.
Add a custom step
Slack owns a step's name, inputs and outputs, so you build the step in the Slack app's settings. Then you set in Willow how the agent runs it.
Build the step in Slack
- In the agent's Triggers tab, select Add a step in Slack workflow steps, then Open in Slack. You can also open the app at api.slack.com/apps.
- Go to Workflow Steps and select Add Step.
- Give the step a name and a callback ID. Don't use
run_agent, which the default step uses. - Add the inputs:
- At least one Person input. The agent acts as this person.
- A Channel input if the workflow should pick where the agent replies.
- Any other inputs the agent needs, such as a ticket title or a description.
- Add outputs that later steps need, such as the agent's answer or a link to its thread.
- Save the step, and reinstall the app when Slack asks.
Willow keeps the steps you build in Slack. Syncing or deploying the agent never removes them.
Set up the step in Willow
-
Back in the agent's Triggers tab, select Refresh in Slack workflow steps. Your step shows as Not set up.
-
Select Set up on the step and fill in:
Setting What it does Mode The mode the agent runs under for this step. Shown when modes are enabled. Instructions for the agent What the agent should do. Select an input's button to insert it as a variable, for example {{ticket_title}}.Acts as The Person input the agent acts as. Reply Where the agent's thread goes: a channel from one of the step's Channel inputs, a fixed channel ID, or a DM to one of the step's Person inputs. Workflow continues Right away, when the agent starts, or When the agent answers. Wait for the answer when a later step needs it. Outputs What Willow writes into each of the step's outputs: the agent's answer, a link to the thread, the thread's channel, the thread timestamp, or a field from the mode's result. The agent's answer is only available when the workflow continues when the agent answers. -
Select Save.
Use the switch on a step to pause it without losing its settings. A paused or deleted step fails in Slack with a message saying it isn't set up. If you delete a step in Slack, it shows here as Missing in Slack so you can remove its settings.
Troubleshooting
| Symptom | What to check |
|---|---|
| The step isn't listed in Workflow Builder | Reinstall the agent's Slack app. Slack only shows steps after a reinstall. Also check that the workspace is on a paid Slack plan. |
| Turn on workflow steps isn't shown | Connect the agent's Slack app first, in the agent's Settings tab. |
| Couldn't read the steps from Slack | Willow reads the steps with your organization's Slack app configuration tokens. Check that they are stored under Channels configurations > Slack. |
| The step fails with "This step isn't set up" | The custom step has no settings in Willow, or it is paused. Select Set up on it, or turn its switch back on. |
| The step fails with "Both Request and Requested by are required" | Fill in both inputs of the default step in Workflow Builder. |
| The workflow never continues | A step that continues when the agent answers waits for the agent's reply. Check the agent's thread in Slack, and that the agent can reply there. |