Overview
A workflow form is a client-facing form attached to a workflow. You define the fields and your end users fill them in. Their answers are saved on the workflow and used the next time it's triggered. A Slack workflow might ask which channel to post to; an onboarding workflow might collect a project name and a start date.
There are two halves, and keeping them straight makes everything else clear:
formis the field schema, the set of fields you define. You author it as the account admin.form_datais the answers, the plain values your end users enter. They fill it in.
Building the form
Define a workflow's form either in the dashboard's form editor or in a config file under the workflow's form key. Saving the schema takes effect immediately, there's no draft or publish step for a workflow form.
A workflow form supports these field types:
| Type | Stores |
|---|---|
TextField | A string |
TextArea | A string |
Number | A number |
Email | A string |
Phone | A string |
Boolean | true or false |
JSON | A JSON string |
Select | The chosen value |
AsyncSelect | The chosen id, or an array of ids when multiple are allowed |
Connection | The id of the connection the user picks |
A Select uses allowed_values: a fixed list or a data List variable. A user-data List resolves only when there's an end-user context. For options fetched from a remote endpoint, use AsyncSelect. Connection is available on a workflow form (it only makes sense on a client form); Secret and Custom are not.
Collecting answers from end users
Present the form to your end users in one of two ways, both covered in the Embedding overview:
- The full settings form (
EWF__settings-form/EwfSettingsForm), which renders every field. - A single field (
EWF__field/EwfField), which renders one field inside your own page.
Answers are saved to the workflow's form_data as plain values: strings, booleans, or arrays of strings, not option objects or wrapped types.
Saving a workflow's settings replaces the entire form_data set, it isn't a partial merge. Submit every field you want to keep, or unsubmitted answers are dropped.
Using the answers
When the workflow runs, each answer is available to its actions as a placeholder by the field's name (and its id): {{ channel }}, {{ start_date }}, and so on.
A Connection field stores the id of the connection the user picked. An action that needs that connection resolves it from the field's value, so a form can let each end user run the workflow against their own connected account.
Related
- Embedding overview: mount a settings form or a single field, and handle
ewf:change - AsyncSelect: options fetched from a remote endpoint
- Authoring a Configuration: define a workflow's
formin a config - Update workflow settings: save
form_datathrough the API
