DEV Community

Aleksandr Argunov
Aleksandr Argunov

Posted on Originally published at argbe.tech AI-assisted

Same cron line, different picker: AI agent vs workflow in YAML

Most AI agents are a CI pipeline with one LLM call in the middle. That's my opinion, not a survey. Putting that pipeline on cron doesn't change what it is.

Six terms get mixed up here. What separates them is who picks the next step.

Six rows, one question: who picks the next step? Chat: you. Workflow: your code. Agent and always-on agent: the model. Swarm: a lead agent. Agentic system: it depends.

Term Who picks the next step Example
AI chat You You paste a Vite build error, get a fix and decide what to try next
Agentic workflow Your code A GitHub Actions or Azure Pipelines job calls the model in one step
Agent The model It reads files, runs bash, edits code and decides when it's done
Always-on agent The model A schedule or a new GitHub issue wakes it, and no person starts the run
Agent swarm A lead agent It hands research, frontend, backend and review to specialists
Agentic system Depends on the wiring CI runs the checks, an agent fixes what fails, and you approve the merge

The workflow and agent split is Anthropic's. Workflows follow predefined code paths. Agents direct their own process and tool use. Anthropic also uses "agentic systems" as the umbrella for both, so a system doesn't need every row. The swarm row is the orchestrator-subagent shape. Multi-agent is wider, and not every pattern has a lead.

The pipeline

Both files are GitHub Actions sketches. Checkout, secrets and the scripts are left out, and neither file has been run.

# Your YAML picks every step.
on:
  schedule:
    - cron: '*/30 * * * *'
jobs:
  fix:
    runs-on: ubuntu-latest
    steps:
      - run: ./scripts/read-log.sh
      - run: ./scripts/ask-model-for-patch.sh # the one LLM call
      - run: npm test
      - run: ./scripts/open-pr.sh
Enter fullscreen mode Exit fullscreen mode

You can read the order before it runs. If npm test fails, the job fails and open-pr.sh doesn't run.

The agent

# The model picks what to read, edit and rerun.
on:
  schedule:
    - cron: '*/30 * * * *'
jobs:
  fix:
    runs-on: ubuntu-latest
    steps:
      - run: ./scripts/run-agent.sh "Fix the failing test. Open a PR. Don't merge."
Enter fullscreen mode Exit fullscreen mode

run-agent.sh stands for whatever agent you run. Claude Code, for example, documents a loop of running the suite, reading the error, editing and rerunning.

The cron line didn't change. The picker did.

The transition that moves is the one after the failure. In the first file, nothing comes next. In the second, the model chooses: another file, another edit, another test run, or stop.

Retries don't settle it. Write a retry loop in YAML and your code still picks.

The second file needs something the first doesn't: a way to end. Anthropic suggests stopping conditions, such as a maximum number of iterations.

Scheduled agent vs workflow on cron

Something always starts a run. That's a separate choice from who picks the steps.

What starts the run Your code picks each step The model picks each step
You A job you trigger by hand A task you give a coding agent
A schedule The first YAML The second YAML, or a cloud scheduled task
An event A YAML job on a new issue An agent woken by a GitHub event you configured

Interval limits differ. GitHub's shortest scheduled interval is 5 minutes. Claude Code's cloud scheduled tasks, formerly routines, are in research preview and reject anything more often than hourly. So 30 minutes works in the YAML above and not there.

One repo, three answers

Take a Next.js repo. No product gives you this flow by being named. You wire it from CI, an agent and Vercel's Git integration.

Step Who picks
Run the checks Your code
Read the failure, fix it The model
Approve the merge You
Deploy Your code

Let the agent propose the patch, and require your approval before merge. An agent picking the next step doesn't mean it picks every step.

Anthropic's advice is to find the simplest solution and add complexity only when needed. It also notes that agentic systems often trade latency and cost for better task performance. That can mean the left column.

Strip the AI names and it's stuff we've had for years.

The maintained version, with all six terms in full and the sources: Is your AI agent a CI pipeline? How the loop itself works is in What is an AI agent harness?

Top comments (0)