prompt
Collect interactive input from users during workflow execution. Supports text, password, select, confirm, and multiselect input types. Automatically skips prompts in non-interactive environments (CI/CD, LLM agents) using default values.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | The prompt message displayed to the user |
| type | string | No | Input type: text (default), password, select, confirm, multiselect |
| default | varies | No | Default value if user presses Enter or running non-interactively |
| options | array | For select/multiselect | List of choices |
Return Values
Section titled “Return Values”| Field | Type | Description |
|---|---|---|
| result.value | string | The user’s input (or default in non-interactive mode) |
| result.type | string | The prompt type used |
| result.interactive | string | ”true” if user was prompted, “false” if default was used |
| result.output | string | Same as value (for consistency with shell function) |
Non-Interactive Mode
Section titled “Non-Interactive Mode”Prompts are automatically skipped when:
ORCHSTEP_NON_INTERACTIVE=trueenvironment variable is set- stdin is not a terminal (piped input, CI/CD runners)
- A
--varmatching the step name provides the value
This means the same workflow works both interactively (human at terminal) and non-interactively (CI/CD pipeline, LLM agent).
# Interactive — prompts appearorchstep run deploy
# Non-interactive — prompts skipped, defaults usedORCHSTEP_NON_INTERACTIVE=true orchstep run deploy
# Override specific prompt — skip that prompt, use provided valueorchstep run deploy --var environment=prodExamples
Section titled “Examples”Text Input
Section titled “Text Input”- name: get_name func: prompt args: message: "Enter your name" type: text default: "World" outputs: name: "{{ result.value }}"Password (Masked)
Section titled “Password (Masked)”- name: get_password func: prompt args: message: "Database password" type: passwordSelect (Single Choice)
Section titled “Select (Single Choice)”- name: choose_env func: prompt args: message: "Target environment" type: select options: [dev, staging, production] default: stagingConfirm (Yes/No)
Section titled “Confirm (Yes/No)”- name: confirm_deploy func: prompt args: message: "Deploy to production?" type: confirm default: falseMultiselect (Multiple Choices)
Section titled “Multiselect (Multiple Choices)”- name: select_features func: prompt args: message: "Features to enable" type: multiselect options: [logging, monitoring, caching, cdn] default: [logging, monitoring]Full Workflow: Interactive Deployment
Section titled “Full Workflow: Interactive Deployment”name: interactive-deploydesc: "Deployment with user confirmation"
defaults: app: "myapp"
tasks: deploy: steps: - name: environment func: prompt args: message: "Target environment" type: select options: [dev, staging, production] default: dev
- name: version func: prompt args: message: "Version to deploy" type: text default: "latest"
- name: confirm func: prompt args: message: "Deploy {{ defaults.app }} v{{ steps.version.value }} to {{ steps.environment.value }}?" type: confirm default: false
- name: execute_deploy if: '{{ eq steps.confirm.value "true" }}' func: shell do: | echo "Deploying {{ defaults.app }} v{{ steps.version.value }} to {{ steps.environment.value }}..." echo "DEPLOY_STATUS=success"Design Philosophy
Section titled “Design Philosophy”The prompt function bridges the gap between interactive runbooks (human at terminal) and automated pipelines (CI/CD, LLM agents):
- For humans: Rich prompts with defaults, validation, and confirmation before destructive actions
- For automation: Same workflow, same YAML — prompts silently use defaults or
--varoverrides - For LLM agents:
ORCHSTEP_NON_INTERACTIVE=trueor provide all values via--var
This means you write ONE workflow that serves all three audiences.