Workflows: workflow_step object

workflow_step object

A workflow_step object holds information about an app's workflow step. This object is used during configuration and execution of a step as well as view submissions. The format of inputs and outputs will depend on the context of the step.

Arguments

Field Type Description
workflow_step_execute_id String An identifier provided with workflow_step_execute event payloads. Used to call back to workflows.stepCompleted or workflows.stepFailed.
workflow_step_edit_id String An identifier provided with view_submission payloads. Used to call back to workflows.updateStep
workflow_instance_id String An identifier provided with workflow_step_execute payloads. Unique to the current execution of the workflow.
workflow_id String An identifier for the workflow that the step is included in. Consistent across workflow executions.
step_id String An identifier for the step within the workflow. Consistent across workflow executions.
inputs Object A key-value map of input objects that specify input required from a user. This is the data your app expects to receive when the workflow step starts.
outputs Object[] An array of output objects created during step execution. This is the data your app promises to provide when your workflow step is executed.

Example

{
	"workflow_id": "12312",
	"step_id": "123894",
	"step_name": "Create Acme Issue",
	"step_image_url": "https://acmecorp.cdn/path/to/square/image.png",
	"inputs": {
		"title": {
			"value": "{{user}} submitted an issue",
			"skip_variable_replacement": false
		},
		"submitter": {
			"value": "{{user}}",
			"skip_variable_replacement": false
		},
		"channel": {
			"value": "{{channel}}",
			"skip_variable_replacement": false
		}
	},
	"outputs": [
		{
			"name": "ticket_id",
			"type": "text",
			"label": "Ticket ID"
		},
		{
			"name": "title",
			"type": "text",
			"label": "Title"
		}
	]
}

input object

An object that holds information about the user inputs for that workflow step.

You can specify variables in your input's value object using a handlebar-like format, e.g. {{variable}}. During workflow execution, those variables will be replaced with their actual runtime value, unless you have skip_variable_replacement enabled. value can be any valid JSON value.

Field Type Description
value Any This is the input value. You can use {{variables}} which are included in the view_submission payload from a configuration modal. These variables refer to input from earlier workflow steps.
skip_variable_replacement Boolean Flag to specify if variables in value should be replaced. Default to true.
variables Object A key-value map of variables to replace

Example

"inputs": {
	"title": {
		"value": "{{user}} submitted an issue",
		"skip_variable_replacement": false
	}
}

output object

An object that holds information about outputs this workflow step will produce. Outputs can be used in subsequent steps of a workflow.

Arguments

Field Type Description
name String Developer defined name that will be used as reference during execution.
type String Type of the expected input. Can be text, channel or user.
label String Label of this input field displayed to the user.

Example

{
	"name":"ticket_id",
	"type":"text",
	"label":"Ticket ID"
}