Workflow button element
Welcome to the new home of Slack developer docs!
We're still building and not all features are available quite yet. Enjoy this peek into the future!
Not ready for the future? Return to the past at api.slack.com.
Example:
Fields
Field | Type | Description | Required? |
---|---|---|---|
type | String | The type of element. In this case type is always workflow_button . | Required |
text | Object | A text object that defines the button's text. Can only be of type: plain_text . text may truncate with ~30 characters. Maximum length for the text in this field is 75 characters. | Required |
workflow | Object | A workflow object that contains details about the workflow that will run when the button is clicked. | Required |
action_id | String | An identifier for the action. Use this when you receive an interaction payload to identify the source of the action. Every action_id in a block should be unique. Maximum length is 255 characters. | Required |
style | String | Decorates buttons with alternative visual color schemes. Use this option with restraint.primary gives buttons a green outline and text, ideal for affirmation or confirmation actions. primary should only be used for one button within a set.danger gives buttons a red outline and text, and should be used when the action is destructive. Use danger even more sparingly than primary .If you don't include this field, the default button style will be used. | Optional |
accessibility_label | String | A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. Maximum length is 75 characters. | Optional |
Example
{
"type": "workflow_button",
"text": {
"type": "plain_text",
"text": "Run Workflow"
},
"action_id": "workflowbutton123",
"workflow": {
"trigger": {
"url": "https://slack.com/shortcuts/Ft0123ABC456/xyz...zyx",
"customizable_input_parameters": [
{
"name": "input_parameter_a",
"value": "Value for input param A"
},
{
"name": "input_parameter_b",
"value": "Value for input param B"
}
]
}
}
}