input
Use the input step primitive to prompt for user input. When the pipeline reaches an input step, it will prompt the user for input and then pause and wait for a response. When a response is received, the pipeline will continue and the step will return the selected value.
When you run a pipeline in client-mode, notifications for input steps will only appear on the command line.
In server-mode, notifications for input steps are not sent to the console. Instead, they are sent to integrations such as Slack or Email via a notifier, allowing you to create collaborative workflows that integrate with your preferred communication channels.
An input step is limited to a single prompt and a single input element. It asks a single question and returns a single answer (value).
You must select a notifier that defines which integration will handle the interaction: Slack, email, or other.
There are multiple input types, but they all share these traits:
- There can be one or more options.
- The options may either be specified in option blocks or as a list of options. The block format is typically preferred when the list of options is statically defined, and the list format is useful when generating the options dynamically.
- Each option must have a value.
- An option may have a label (display value). If no label is specified, the value is used as the label.
- An option may be selected by default.
Arguments
Argument | Type | Optional? | Description |
---|---|---|---|
notifier | Notifier Reference | Required | The notifier to send the request to send the message. |
cc | List<String> | Optional | The email addresses to send to. This only applies to notifiers that uses email integrations. |
bcc | List<String> | Optional | The email addresses to send to. This only applies to notifiers that uses email integrations. |
channel | String | Optional | The channel to send the request to. This only applies to slack integrations. |
option | Block | Optional | The available options to present to the user as option blocks. You may either specify one or more option blocks or a single options list, but not both. |
options | List | Optional | The available options to present to the user as a list of objects. You may either specify one or more option blocks or a single options list, but not both. |
prompt | String | Optional | The text to present to the user as a prompt |
subject | String | Optional | The email subject. This only applies to notifiers that uses email integrations. |
to | List<String> | Optional | The email addresses to send to. This only applies to email integrations. |
type | String | Required | The input type to present to the user |
This step also supports the common step arguments and attributes.
Attributes (Read-Only)
Attribute | Type | Description |
---|---|---|
value | String | The value that the user has selected. This may be a scalar value (when the type is button, text, select) or a list (when the type is multiselect). |
Input Types
Type | Description |
---|---|
button | Click a button |
text | Enter a single line of text |
select | Select a single item from a dropdown list |
multiselect | Select one or more items from a dropdown list |
Button - Simple
Console (Client-Mode)
HTTP
Slack
Button - With labels and values
Console (Client-Mode)
HTTP
Slack
Select - basic
Console (Client-Mode)
HTTP
Slack
Select - with labels & default selection
Console (Client-Mode)
HTTP
Slack
Multiselect - basic
Console (Client-Mode)
HTTP
Slack
Multiselect with labels & default selection
Console (Client-Mode)
HTTP
Slack
Options
The available options to present to the user are specified in either option blocks, or in the options list. You may either specify one or more option blocks or a single options list, but not both.
If no arguments are passed to an option, then the block label is used as both the label (the text to display) and value (the value to return if this option is selected):
Each option may optionally specify a label (the text to display) and a value (the value to return if this option is selected). For some types, you may specify a boolean selected value to pre-select the item:
You may instead pass all options as a list in the options argument:
The options list form is useful for building the options dynamically:
Additionally, when using button input type, you can colorize the buttons by setting the style attribute on an option:
Arguments
Argument | Type | Optional? | Description |
---|---|---|---|
label | String | Optional | The text to display for the option. |
value | String | Optional | The value to return when the option is selected. |
selected | Boolean | Optional | Set to true to pre-select the option. |
style | String | Optional | Set to ok, alert, info (default) to colorize option when used as a button. |