Executing steps from apps
Steps from apps are a deprecated feature.
Steps from apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new Slack automation features, such as custom steps for Bolt.
Please read the Slack API changelog entry for more information.
When your step from app is executed by an end user, your app will receive a workflow_step_execute
event. The execute
callback in your WorkflowStep
configuration will be run when this event is received.
Using the inputs
from the save
callback, this is where you can make third-party API calls, save information to a database, update the user's Home tab, or decide the outputs that will be available to subsequent steps from apps by mapping values to the outputs
object.
Within the execute
callback, your app must either call complete()
to indicate that the step's execution was successful, or fail()
to indicate that the step's execution failed.
Refer to the module documents (common / step-specific) to learn the available arguments.
def execute(step, complete, fail):
inputs = step["inputs"]
# if everything was successful
outputs = {
"task_name": inputs["task_name"]["value"],
"task_description": inputs["task_description"]["value"],
}
complete(outputs=outputs)
# if something went wrong
error = {"message": "Just testing step failure!"}
fail(error=error)
ws = WorkflowStep(
callback_id="add_task",
edit=edit,
save=save,
execute=execute,
)
app.step(ws)