Prompts
Prompts are predefined flags and options specific to each template type that you can enable to allow runtime customization. Unlike Survey Variables which are custom fields you create, prompts are built-in options that correspond to specific CLI flags for Ansible, Terraform, and other tools.
This feature allows you to:
- Override template defaults at runtime
- Target specific hosts or resources
- Control execution behavior with CLI flags
- Pass runtime options via API calls or schedules
Prompts vs. Survey Variables
| Feature | Prompts | Survey Variables |
|---|---|---|
| Definition | Predefined template-specific options | Custom fields you create |
| Examples | Ansible: --limit, --tagsTerraform: workspaces, -destroy | Environment name, version number, custom parameters |
| Configuration | Enable via checkboxes in template | Add in template settings with name and type |
| Passed as | Built-in CLI flags | Ansible: --extra-varsTerraform: -var |
Prompts are standardized options built into Semaphore for specific tools, while Survey Variables are flexible custom fields you define yourself.
Ansible Prompts
For Ansible playbook templates, you can enable prompts for the following CLI options:
Limit
Enable the --limit prompt to specify which hosts to target when running the playbook.
CLI equivalent: ansible-playbook playbook.yml --limit webservers
Use cases:
- Run playbook on a subset of inventory hosts
- Target specific servers for deployment
- Test changes on a single host before rolling out
Example:
- Your inventory contains 50 web servers
- Enable the Limit prompt
- When running the task, specify
web-01.example.comto target only that server - Or specify
webservers:&productionto target production web servers
Tags
Enable the --tags prompt to run only tasks with specific tags.
CLI equivalent: ansible-playbook playbook.yml --tags deploy,restart
Use cases:
- Execute only specific parts of a playbook
- Run deployment steps without configuration tasks
- Quickly restart services without full playbook execution
Example:
---
- hosts: all
tasks:
- name: Install packages
apt:
name: nginx
tags: install
- name: Deploy application
copy:
src: app.tar.gz
dest: /opt/app/
tags: deploy
- name: Restart service
service:
name: nginx
state: restarted
tags: restart
Enable the Tags prompt and enter deploy,restart to skip the installation step.
Skip Tags
Enable the --skip-tags prompt to skip tasks with specific tags.
CLI equivalent: ansible-playbook playbook.yml --skip-tags testing,debug
Use cases:
- Skip optional tasks in production
- Exclude debug or testing tasks
- Bypass time-consuming tasks when not needed
Example: Using the playbook above, enable Skip Tags and enter install to skip package installation and only run deployment and restart tasks.
Skip Galaxy install
Enable the prompt to let the user skip the ansible-galaxy install step for roles and collections when running the task.
Use cases:
- Requirements are already installed in the runner image
- Save time on repeated runs when nothing changed in
requirements.yml
Force Galaxy install
Enable the prompt to let the user force ansible-galaxy install --force for every requirements file, ignoring the requirements checksum Semaphore keeps between runs.
CLI equivalent: ansible-galaxy role install -r requirements.yml --force
Use cases:
- A requirements file references a branch rather than a fixed version and you need the latest commit
- A previous install left roles or collections in a broken state
- Verify that a playbook works from a clean set of dependencies
See Galaxy requirements for how the template-level defaults work.
Enabling Ansible Prompts
To enable Ansible prompts:
- Go to Task Templates and select your Ansible template
- Look for the Ansible Prompts section in template settings
- Enable checkboxes for the prompts you want:
- ☐ Limit - Enable
--limitflag - ☐ Tags - Enable
--tagsflag - ☐ Skip Tags - Enable
--skip-tagsflag - ☐ Debug - Enable verbosity (
-v) selection - ☐ Skip Galaxy install - Allow skipping
ansible-galaxy install - ☐ Force Galaxy install - Allow forcing
ansible-galaxy install --force
- ☐ Limit - Enable
- Save the template

When enabled, these fields appear in the task run form, API requests, and schedule configurations.
Terraform/OpenTofu Prompts
For Terraform and OpenTofu templates, Semaphore provides several built-in prompts:
Workspace Selection
Select which Terraform workspace to use for the task execution.
CLI equivalent: terraform workspace select staging
Use cases:
- Manage multiple environments (dev, staging, production)
- Separate state files for different configurations
- Test infrastructure changes in isolation
Setup:
- Create workspaces in the template's Workspaces tab
- The workspace selector automatically appears in the task form
- Users choose the target workspace when running tasks
See Terraform Workspaces for detailed setup.
Destroy Flag
Enable the -destroy flag to tear down infrastructure.
CLI equivalent: terraform apply -destroy
Use cases:
- Clean up temporary test environments
- Decommission infrastructure
- Remove specific resources
Important: This is a destructive operation. Use with caution and consider requiring confirmation in your workflows.
Migrate State Flag
Enable the -migrate-state flag when changing backend configuration.
CLI equivalent: terraform init -migrate-state
Use cases:
- Move state to a different backend
- Migrate between storage locations
- Update backend configuration
Enabling Terraform Prompts
Terraform prompts are available in the template settings:
- Go to Task Templates and select your Terraform template
- Configure available prompts in template settings:
- Workspace selection (automatically enabled if workspaces are configured)
- Destroy flag option
- Migrate state option
- Save the template
The task form displays these options when running Terraform tasks.
Bash, PowerShell, and Python Prompts
For Bash, PowerShell, and Python templates, prompts are minimal as most customization is handled through Survey Variables.
Available prompts are:
- CLI args
- Branch
These template types benefit more from custom Survey Variables for passing parameters to scripts.
Using Prompts
Manual Task Execution
When running a task from a template with prompts enabled:
- Click Run on the template
- A form appears with enabled prompt fields
- Fill in values for the prompts you want to use (optional fields can be left empty)
- Click Run Task
The task executes with your specified prompt values passed as CLI flags.
API Calls
To pass prompt values via API, include them in the request payload:
Ansible example:
curl -XPOST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{
"template_id": 123,
"limit": "webservers",
"tags": "deploy,restart",
"skip_tags": "testing"
}' \
https://your-semaphore.com/api/project/1/tasks
Important: Prompts must be enabled in the template for the values to be accepted. If you pass prompt values via API without enabling them, those values will be ignored.
Scheduled Tasks
Schedules can include prompt values to customize automated task execution:
Example: Schedule with Ansible prompts
- Daily deployment schedule with
limit: "production"andtags: "deploy" - Weekly maintenance schedule with
tags: "updates,cleanup"
Configure prompt values in the schedule settings so each scheduled run uses the specified options.
Integrations and Webhooks
Integrations can extract values from webhooks and map them to prompts:
Example: GitHub webhook triggers deployment
- Extract branch name from webhook
- Map to Limit prompt to target specific environment
- Deploy only to servers matching the branch environment
See Integrations for webhook configuration.
Best Practices
Enable only necessary prompts
Each enabled prompt adds a field to the task form. Only enable prompts that users will actually need to customize.
✅ Good: Enable Limit for operations teams who need to target specific hosts ❌ Bad: Enable all prompts "just in case"
Combine with Survey Variables
Use prompts for tool-specific CLI options and Survey Variables for custom parameters:
Example Ansible template:
- Prompts: Limit (which hosts), Tags (which tasks)
- Survey Variables:
app_version(which version),enable_rollback(custom logic)