forcedotcom/sf-skills / skills/dx-devops-request-status
dx-devops-request-status
VerifiedUse this skill to poll the status of an asynchronous DevOps Center request — a promotion or deploy operation. Provide the request token returned by dx-devops-promote (the promote response) to check completion, monitor progress, or verify success or failure via sf devops request status. TRIGGER when the user wants to check whether a promotion or deploy finished, monitor an in-flight async request, poll until a request completes, or confirm a request succeeded before finalizing. DO NOT TRIGGER for initiating a promotion or deploy (use dx-devops-promote), for work item creation or status transitions (use dx-devops-work-item-manage), or for conflict detection. Read-only status check — never mutates pipeline state.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.5 KB |
| examples/polling-workflows.md | markdown | 4.7 KB |
| references/cli-commands.md | markdown | 7.9 KB |
| scripts/poll-status.shexecutable | script | 5.9 KB |
examples/polling-workflows.md
View on GitHub# Request Status Polling Examples
Common patterns for checking the status of an asynchronous DevOps Center request via `sf devops request status`. Every pattern is **read-only** — it issues only status queries and never mutates pipeline state. The request token is returned by `dx-devops-promote` in the promote response.
---
## Example 1 — One-shot status check (with the two-level outcome check)
**User prompt:** "What's the status of request 708b2286-bbf3-4621-9531-6d94334ff763?"
```bash
# 1. Verify auth
sf org display --json
# 2. Single deterministic status check. --once queries once and derives the TRUE
# outcome (.result.status alone is not enough — the status is operation-prefixed
# and a *SUCCESS* status can carry a failed deploy in errorDetails). The script
# owns the two-level rule so it stays consistent with the polling path.
scripts/poll-status.sh --once 708b2286-bbf3-4621-9531-6d94334ff763 my-devops-org
# Exit codes: 0 succeeded · 2 operation failed · 4 still processing · 1 query error
```
For the real response above, `status` is a `*SUCCESS*` value but `errorDetails` is populated, so the script exits `2` and prints the derived failure: **`DEPLOYMENT_FAILURE: classes/HelloMCP.cls-meta.xml: Invalid api version:0.0`**.
**Report:** "Request `708b2286…` finished but the deploy FAILED — `DEPLOYMENT_FAILURE`: invalid API version on `HelloMCP.cls-meta.xml`." Never report success from a `*SUCCESS*` status alone.
---
## Example 2 — Poll until the request completes
**User prompt:** "Poll request a0B000000000200 until it finishes."
```bash
# scripts/poll-status.sh polls every 10s (default), caps at 30 min (default),
# stops on a terminal state, and exits non-zero on failure or timeout.
scripts/poll-status.sh a0B000000000200 my-devops-org
# Custom interval/timeout: scripts/poll-status.sh a0B000000000200 my-devops-org 15 900
```
The script prints progress lines while polling and a final line. It applies the two-level outcome check (request-finished AND `errorDetails` null). Exit codes:
- `0` — request finished and the operation succeeded (`errorDetails` null)
- `2` — request finished but the operation FAILED (`errorDetails` set, or status suffix `*FAILED*`/`*ERROR*`/`*CANCELED*`) — reason printed to stderr
- `3` — timeout reached, still processing
**Report:** on exit `0`, "Request `a0B000000000200` completed successfully. Run `sf devops promotion complete` to finalize (owned by `dx-devops-promote`)."
---
## Example 3 — Hand-off from a promotion
**Scenario:** `dx-devops-promote` initiated a promotion and returned a request token. Confirm completion before finalizing.
```bash
# REQUEST_TOKEN was captured by dx-devops-promote from the promote response.
# Poll it to a terminal state.
if scripts/poll-status.sh "$REQUEST_TOKEN" my-devops-org; then
echo "Request $REQUEST_TOKEN succeeded — ready to finalize."
# Finalization is the caller's step (dx-devops-promote), NOT this skill:
# sf devops promotion complete --target-stage-id <target-stage-id> --target-org my-devops-org --json
else
echo "Request $REQUEST_TOKEN did not succeed — see status output above." >&2
fi
```
**Report:** relay the terminal status. Do not run `promotion complete` from this skill — hand back to `dx-devops-promote`.
---
## Example 4 — Timeout while still processing
**User prompt:** "Check request a0B000000000300, wait up to 5 minutes."
```bash
# 300s timeout, 15s interval
scripts/poll-status.sh a0B000000000300 my-devops-org 15 300
# Exit code 3 means the request was still processing at the 5-minute cap.
```
**Report:** "Request `a0B000000000300` was still in progress (e.g. `PROMOTE_IN_PROGRESS`) after 5 minutes. It has not failed — poll again later to confirm completion." Do NOT report success or failure for a request that has not finished processing.
---
## Example 5 — Failed operation vs. failed query
**Scenario:** distinguish a failed *query* (bad token / auth) from a failed *operation* (request finished, but `errorDetails` set).
```bash
# The exit code distinguishes the two failure modes: 1 = the QUERY failed (bad
# token / auth), 2 = the query succeeded but the OPERATION failed (errorDetails
# set, even when .result.status is a *SUCCESS* value).
scripts/poll-status.sh --once a0B000000000400 my-devops-org
case $? in
1) echo "Query itself failed — check the request token and org auth." >&2 ;;
2) echo "Operation failed — see the parsed errorType/errorMessage above." ;;
0) echo "Operation succeeded." ;;
4) echo "Still processing — poll to completion (Example 2)." ;;
esac
```
**Report:** a failed operation (non-null `errorDetails`) is a valid result — report the parsed `errorType`/`errorMessage`. If it failed on a metadata conflict, hand back to `dx-devops-promote` to resolve and re-promote.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |