DeterministicOps
GitHub Agentic Workflows can combine deterministic computation (steps: and jobs:) with AI reasoning, enabling hybrid agentic data preprocessing. This pattern can reliably collect and prepare data, then the AI agent reads the results and generates insights. Use this for data aggregation, report generation, trend analysis, auditing, and any hybrid pipeline.
When to Use
Section titled “When to Use”Combine deterministic steps with AI agents to precompute data, filter triggers, preprocess inputs, post-process outputs, or build multi-stage computation and reasoning pipelines.
Example: Release Highlights Generator
Section titled “Example: Release Highlights Generator”This workflow generates release highlights for new tags. It uses deterministic steps to fetch structured data about the release and recent PRs, then the AI agent synthesizes this into a release summary.
When using steps: or jobs:, files placed in /tmp/gh-aw/agent/ are automatically uploaded as artifacts and available to the AI agent.
flowchart TD
det[Deterministic steps] -- artifacts --> agent[AI agent]
agent -- safe-outputs --> so[Safe output jobs]
Example workflow:
---on: push: tags: ['v*.*.*']
safe-outputs: update-release:
steps: - run: | gh release view "${GITHUB_REF#refs/tags/}" --json name,tagName,body > /tmp/gh-aw/agent/release.json gh pr list --state merged --limit 100 --json number,title,labels > /tmp/gh-aw/agent/prs.json env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}---
# Release Highlights Generator
Generate release highlights for `${GITHUB_REF#refs/tags/}`. Analyze PRs in `/tmp/gh-aw/agent/prs.json`, categorize changes, and use update-release to prepend highlights to the release notes.Data Caching
Section titled “Data Caching”For workflows that run frequently or process large datasets, use GitHub Actions caching to avoid redundant API calls:
---cache: - key: pr-data-${{ github.run_id }} path: /tmp/gh-aw/pr-data restore-keys: | pr-data-
steps: - name: Check cache and fetch only new data run: | if [ -f /tmp/gh-aw/pr-data/recent-prs.json ]; then echo "Using cached data" else gh pr list --limit 100 --json ... > /tmp/gh-aw/pr-data/recent-prs.json fi---Deterministic Trigger Filtering
Section titled “Deterministic Trigger Filtering”Deterministic steps can also be used for Custom Trigger Filtering, to control whether the agentic workflow should run based on complex conditions that are easier to express in code than in workflow expressions.
Deterministic Post-Processing
Section titled “Deterministic Post-Processing”Custom Safe Outputs can also be used for deterministic post-processing of AI outputs.
---on: pull_request: types: [opened]
safe-outputs: jobs: format-and-notify: description: "Format and post review" runs-on: ubuntu-latest inputs: summary: {required: true, type: string} steps: - ...---
# Code Review Agent
Review the pull request and use format-and-notify to post your summary.Related Documentation
Section titled “Related Documentation”- Pre-Activation Steps — Inline step injection into the pre-activation job
- Pre-Activation Permissions — Grant additional scopes for
on.steps:API calls - Custom Safe Outputs — Custom post-processing jobs
- Frontmatter Reference — Configuration options
- Compilation Process — How jobs are orchestrated
- Imports — Sharing configurations across workflows
- Templating — Using GitHub Actions expressions