Script Workflows
Chain scripts together with conditional branching, run history, and optional scheduling so an entire sequence runs as a single coordinated job.
Script Workflows
A Script Workflow runs a sequence of saved scripts on a server as one coordinated job. Each step points at a script you've already created, and for every step you decide what happens next: move to the next step, jump to a specific step, stop, or finish successfully. This replaces ad-hoc "run script A, then B, then maybe C" checklists with a reproducible pipeline you can execute on demand, trigger from a webhook, or schedule with cron.
Workflows live on a specific server. To run the same sequence across many servers, pair the workflow with Multi-Server Execution for individual steps, or run the workflow from an external orchestrator that targets each server.
What a Workflow Contains
Every workflow has a name (up to 255 characters), an optional description (up to 1000 characters), and an ordered list of steps — at least one. You also pick how the workflow is kicked off: manually from the UI, on a recurring schedule (using a cron expression), or from an external webhook. Each workflow has an active/inactive toggle; inactive workflows can still be executed manually but won't fire on their schedule or webhook.
Step definition
Every step is a pointer to a saved script plus a little control logic around it:
- Script — The saved script to run in this step.
- Timeout — Per-step time budget. Defaults to 5 minutes, configurable from one second up to an hour.
- On success — What to do after the step succeeds: move to the next step (default), finish the workflow, or jump to a specific step number.
- On failure — What to do if the step fails: stop the whole workflow (default), continue to the next step anyway, or jump to a specific step number for a recovery or rollback path.
If a step is somehow missing its script, Devpilot marks it as skipped and moves on without raising an error.
Creating a Workflow
Open the Workflows tab
From a server's dashboard, open Workflows and click Create Workflow.
Name and describe it
Enter a clear name (for example "Release v1.7.0") and, optionally, a description so teammates know what the workflow does.
Add steps in order
Click Add Step for each script in your pipeline. Pick the script, set its timeout, and decide what happens on success and failure. A typical deployment workflow might be:
- Pull latest code — on success move to the next step, on failure stop.
- Run migrations — on success move on, on failure jump to the rollback step.
- Restart services — on success finish the workflow, on failure jump to the rollback step.
- Rollback — always finish the workflow.
Choose how it runs
- Manual — You run it from the UI on demand.
- Cron — Provide a cron expression and the workflow fires on that cadence whenever it's active.
- Webhook — Use a Script Webhook on the first step's script to kick off the workflow from GitHub, an alerting service, or any HTTP client.
Run and review
Click Run Now to execute the workflow. Every run is captured in the workflow's History tab with per-step results, total duration, and a final status.
Branching Logic
The on success and on failure settings let you build conditional pipelines without writing glue scripts:
Every step moves on after success and continues on failure. The workflow keeps going end-to-end and only the final step decides overall success or failure. Failures are still logged on each step so you can review them later.
Every step moves on after success but stops the whole workflow on failure. Any single failing step aborts the run immediately and marks it failed. Best for deploys where a broken step makes subsequent steps meaningless.
Each of the main steps jumps to a dedicated rollback step on failure, and the rollback step finishes the workflow cleanly. A failure anywhere in the deploy sequence shortcuts straight into the recovery path instead of proceeding or dying silently.
Run History
Every execution creates a run record you can open from the workflow's History tab. Each run shows its overall status (Running, Completed, or Failed), which step was last reached, total wall-clock duration, and a per-step breakdown with each step's status (started, skipped, or failed), a link into the underlying script execution for full streamed output, and an error message if the step didn't succeed.
The History tab shows the 20 most recent runs, newest first. Open any run to drill into individual step outputs.
A step's "started" status means Devpilot handed the script off for streaming execution. The actual stdout, stderr, exit code, and duration are captured on the underlying script execution record — workflows track orchestration, the script itself owns the per-run output.
Real-World Example
A small release workflow on an app server might chain five scripts: pull latest code, run database migrations, restart services, run a smoke test, and a rollback script at the end. The first four steps each succeed forward, and on any failure they all jump to the rollback step. When the smoke test passes, the workflow finishes cleanly without touching rollback; when anything fails, the pipeline lands on rollback before ending.
Because every step records the underlying execution, the run's history entry lets you trace the full output of every phase — the migrations, the restart, and (if it ran) the rollback — from a single page.
Limits and Constraints
- A workflow needs at least one step.
- Step timeout accepts one second up to one hour; the default is 5 minutes.
- Workflow names are limited to 255 characters; descriptions to 1000.
- The run history shows up to 20 runs per view; older runs are retained and paginated out of the default view.
Troubleshooting
| Problem | Likely cause |
|---|---|
| Run stuck in Running | The step's underlying execution hasn't reported completion yet; open it from the run detail. |
| Step shows "skipped" | The step is missing its script. Edit the workflow and pick a script for that step. |
| Run ends prematurely as Failed | A step hit its "on failure: stop". Open the step result for the error. |
| Cron workflow never fires | The workflow is inactive, or the cron expression is invalid. Activate it and check the expression. |
| Webhook trigger doesn't start it | Make sure the first step's script has an active webhook and the token is correct. |
Next Steps
Scripts and Automation
Start with the basics of creating and running individual scripts.
Script Triggers
Fire a workflow's first step when a server metric crosses a threshold.
Script Webhooks
Kick off a workflow from GitHub, a monitoring tool, or any HTTP client.
Script Versions
Review the history of every script used as a workflow step.
Scripts and Automation
Create, execute, schedule, version, and chain bash scripts on your servers. Use AI assistance, webhooks, metric triggers, secrets, and multi-server execution.
Script Triggers
Run a script automatically when a server metric crosses a threshold, with duration, cooldown controls, and a full audit trail.