Skip to content
Block Kit for React
Esc
↑↓navigate↵open⌘Jpreview
On this page

Workflow button

A button that runs a Slack workflow's link trigger.

workflow_button looks like a regular button with a small lightning-bolt glyph, and carries a workflow object describing the link trigger it runs when clicked.

Your AppAPP
onActionInteract with the preview.

Fields

PropType
typestring

Always `workflow_button`.

Typestring
textPlainTextElement

The button's label. Truncates around 30 characters. Maximum length is 75 characters.

TypePlainTextElement
workflow{ trigger: { url: string; customizable_input_parameters?: { name: string; value: string }[] } }

The link trigger this button runs, and any input values to pass to it.

Type{ trigger: { url: string; customizable_input_parameters?: { name: string; value: string }[] } }
style?"primary" | "danger"

`primary` renders green, `danger` renders red. Omit for the default gray style.

Type"primary" | "danger"
accessibility_label?string

Read by screen readers instead of `text`. Maximum length is 75 characters.

Typestring
confirm?ConfirmationDialog

Shows a confirmation dialog before the click is dispatched. See Confirmation dialogs.

TypeConfirmationDialog

Examples

Primary style

Your AppAPP
onActionInteract with the preview.

Interactivity

Clicking the button (after any confirm dialog is accepted) calls onAction with a workflow_button action carrying the workflow object and text back verbatim:

{
  "type": "workflow_button",
  "action_id": "run_workflow",
  "block_id": "workflow",
  "action_ts": "1706000000.000100",
  "text": { "type": "plain_text", "text": "Run workflow", "emoji": true },
  "workflow": {
    "trigger": {
      "url": "https://slack.com/shortcuts/Ft0123ABC456/321cba",
      "customizable_input_parameters": [
        { "name": "input_parameter_a", "value": "Value for input param A" }
      ]
    }
  },
  "style": "primary"
}

style is only included when the element sets it. A workflow button doesn’t write to state.values: it’s a one-shot action.

Was this page helpful?