Use this when organizing GitHub Actions jobs, their order with needs and their outputs.
Jobs · GitHub Actions
Jobs in a GitHub Actions workflow run on separate runners, in parallel by default or in order with needs:, and each job is a sequence of steps sharing one workspace.
1. Jobs run on separate runners.
2. needs for ordering.
3. timeout-minutes.
4. if: conditions.
5. Outputs to pass data.
workflow → jobs (parallel/needs) → results
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Inspect the concrete workflow run and enumerate generated jobs, including matrix variants. Verify each job’s databaseId, dependencies, runner labels/environment, status and conclusion. Deliberately test a dependency failure to confirm downstream skip/always() behavior matches intent, and test environment approval/concurrency if used. For artifact handoff, verify the producing job’s artifact digest/name and the consuming job’s downloaded artifact. If a deployment job succeeds, independently query the deployment target/version after it completes. For self-hosted jobs, show the expected runner instance/group was used. Verification should distinguish “job was not created because expression evaluated false,” “job queued,” “job skipped,” “job failed,” and “job succeeded but downstream target verification failed.” For GitHub Actions → Jobs, retain the pre-state, concrete execution/correlation identifiers and independent post-state together so the same claim can be checked later without interpreting a generic success message.
Step 2 Common mistakes Narrow the fault
- Jobs without
timeout-minutes.
Step 3 Where it fails Narrow the fault
The job boundary sits between workflow graph evaluation and step execution. Failures can come from expression/needs logic, environment approval, runner availability, permissions, timeout, individual steps or external targets. A skipped job is not the same as a passing job; a queued job does not indicate runner failure until matching capacity/labels are checked. Matrix fail-fast can cancel siblings after one failure, which is different from those siblings failing themselves. Do not rerun a deployment job until target state from the prior attempt is known. Preserve job/run IDs and runner/environment context, diagnose the earliest unmet condition, and then re-run the original workflow path plus external verification. For GitHub Actions → Jobs, remediation should change the first failing step and then repeat the original bounded operation plus independent read-back; avoid broad retries or scope expansion while target state is uncertain.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Jobs run in parallel by default.
- needs: creates order and passes outputs.
- Each job runs on its own runner.
gh run view <run-id>— jobs- needs: dependencies — ordering
- timeout-minutes per job — limits
ReferenceWhy it matters1 section · depth on demand
In depth
Jobs are the units a GitHub Actions workflow runs; each job gets a fresh runner, runs its steps in order, and by default runs in parallel with other jobs unless needs: creates a dependency.
jobs:
test:
runs-on: ubuntu-latest
steps: [ { uses: actions/checkout@v4 }, { run: make test } ]
deploy:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: [self-hosted, lab]
environment: lab
steps: [ { run: make deploy } ]
Jobs share data only through artifacts, caches or outputs, since each starts on a clean machine.
ReferenceImportant terms & boundaries2 sections · depth on demand
Known-good, transitional and broken reference
Jobs — comparative operational reference for GitHub Actions → Jobs. What it does not show: request acceptance or job success does not show target change, effective state or workload recovery Next check: move one step toward the original workload using Follow one job ID through queue and worker, verify exactly-once/idempotent target outcome, read effective state and run the original workload after terminal completion. Platform/scope: Queue visibility, retry and acknowledgement semantics vary by scheduler/broker/worker implementation.
Mechanics
A GitHub Actions job is a scheduling and isolation unit inside one workflow run. jobs.<job_id> defines dependencies (needs), conditions, permissions, environment, runner selection, timeouts and steps; matrix strategy can expand one job definition into many concrete job instances. By default jobs without dependencies can run in parallel, so ordering must be explicit. Each job runs in a fresh GitHub-hosted runner environment or on a selected self-hosted runner; filesystem/process state is not automatically shared between jobs, so data crosses boundaries through outputs, artifacts, caches or external systems. Job-level if, environment approvals and concurrency can prevent or delay execution. Therefore “workflow started” does not mean every job ran, and a skipped dependency can propagate skip behavior to downstream jobs. For GitHub Actions → Jobs, keep runtime identity, ownership, durable intent and consumer-visible target state as separate facts; this prevents a controller status or similarly named object from being mistaken for the state the automation is meant to manage.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
Design jobs around clear responsibility and artifact/state boundaries. Keep dependencies minimal and explicit so unrelated work can parallelize without hidden ordering assumptions. Set job-level permissions to least privilege, define timeout behavior, and use environments for protected deployments. Matrix dimensions should be bounded and versioned; uncontrolled dynamic matrices can create excessive workload. Use artifacts for immutable handoff and outputs for small structured metadata rather than depending on runner-local files. Self-hosted runner labels/groups and cleanup are lifecycle dependencies. Reusable workflow/job contracts should version inputs/outputs. When modifying needs, if, matrix, permissions or runner labels, test both positive and skipped/failure paths because graph semantics can change without touching step code. For GitHub Actions → Jobs, a fresh non-interactive execution should be reproducible from reviewed prerequisites and versioned intent, with explicit credentials, target scope, dependency versions and rollback/recovery ownership rather than hidden operator-session state.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in GitHub Actions > Jobs. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax · confidence 94%Quick lookup tables
GitHub Actions → Jobs · operational reference
Context-specific ownership, verification, output and failure-boundary lookup for GitHub Actions → Jobs.
| Layer | GitHub Actions → Jobs operational reference |
|---|---|
| Runtime/ownership | GitHub Actions jobs current · identify controller/worker/target ownership before mutation |
| Persistent intent | Versioned configuration/playbook/workflow with explicit dependencies and least-privilege identity |
| Verification | gh run view <run-id> --json jobs --jq ".jobs[] / {name,databaseId,status,conclusion,startedAt,completedAt}" |
| Expected interpretation | Each expected job instance exists with the correct dependencies/matrix/runner/permissions and has a conclusion that is interpreted separately from downstream service state. |
| Recovery boundary | Preserve correlation IDs + pre-state, then verify target/service independently after remediation |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Retain workflow run ID plus job database ID/name, matrix values, needs context, runner name/labels, environment, start/completion times, status/conclusion and artifact/output identifiers. A single workflow conclusion loses important detail when parallel jobs have different outcomes. Job logs should be linked by stable ID and redacted for secrets. For matrix jobs, include the dimension tuple in dashboards so one platform/version failure is immediately visible. Report skipped/cancelled distinctly from successful no-op. If a job sets outputs used downstream, capture the non-sensitive values or hashes and consumer relationship. For deployments, add target read-back as a separate result instead of overwriting the job conclusion. For GitHub Actions → Jobs, machine-usable identifiers/properties should be captured before presentation formatting; summaries should link back to the exact execution and target records used for the decision.