gitstalk
Docs: Automations

Automations live

An automation is an agent defined by a file in .gitstalk/automations/. It runs when something happens in the repository, on a schedule or by hand, in a fresh container with a memory of its own, and it may propose fixes as beans.

Live on the hosted service since 9 October 2026. The browser builder is beta.

An example

This one wakes when a bean's pre-land check goes red, and every Monday at 09:00 UTC. It may push fix beans as itself and may spend up to 50 cents a run.

.gitstalk/automations/fix-red.yml
name: Fix red beans
on:
  bean_red:                     # a bean's pre-land check went red
  schedule: [{ cron: "0 9 * * 1" }]
permissions:
  beans: write                  # may push fix beans as itself
max-cost-usd: 0.50
prompt: |
  Read why the bean went red. Check your memory for this failure.
  Fix it in a new bean and note what you tried and learned.

A .md file works too: YAML front matter between --- lines, and the body is the prompt. Push the file as a bean. It goes live when the stalk takes it.

What you see

acme / api private
Fix red beansactive fix-red.yml
Triggers bean_red, schedule 0 9 * * 1
Runs     a prompt on @cf/moonshotai/kimi-k2.7-code
Acts as  fix-red[automation]
May      read and push beans
Secrets  none
Memory   refs/automations/fix-red/memory
Limits   30 min, 40 turns, $0.50
Run workflow
Invalid:1 file does not run until fixed.
Each automation shows its triggers, what it runs, who it acts as, its memory ref and its limits. A file with a problem is listed with the line and the reason, and does not run. Maintainers and the owner see the Run workflow button.
Fix red beansrunning bean_red, bean/rename-cache
Restore memory3s
Run the agent41s
Save memory
[Run the agent] turn 6: git diff origin/sprout...bean/rename-cache
[Run the agent] turn 7: node --test
[Run the agent] turn 8: pushing bean/fix-rename-cache
What it did
Beans pushed   bean/fix-rename-cache
Memory         new at 3f9a1c2 → 8be40d7
Model calls    9 · 41,200 in · 3,100 out
Spend          $0.0515 of $0.50
The run streams the agent's turns live. The page then shows the beans it pushed, its memory before and after (each a commit you can open), and its model calls and spend. Logs are kept 30 days.

The pieces

Files in git

Each time the stalk moves, Gitstalk reads the automation files at the new head and rebuilds its index. Changing an automation is a bean like any other. To keep agents and writers away, list .gitstalk/** in protected-paths of .gitstalk/checks.yml.

Triggers

Gitstalk events, a schedule, or workflow_dispatch by hand. See the table below.

Harness

Prompt (harness: agent, the default) runs a model agent. Shell (harness: shell) runs a script with no model.

Models

Nine Workers AI models, default @cf/moonshotai/kimi-k2.7-code. The container never holds a model key.

Memory

A directory kept in git at refs/automations/<name>/memory. Every run's notes are a commit you can read, diff or revert.

Identity

Pushes as <name>[automation]. With beans: write it may push bean/* only.

Triggers

on: When
bean_opened A bean is pushed
bean_landed A bean lands on the sprout
bean_red A bean's pre-land check is red, or it conflicts
bean_parked A bean waits for a person
bean_dropped A bean falls off
bean_reverted A bean is taken off the sprout
stalk_moved The sprout is promoted to the stalk
stalk_reset The stalk goes back
validation_red A validation is red
decision_opened A decision card opens
decision_decided A decision card is answered
schedule Cron in UTC, at least 5 minutes apart
workflow_dispatch By hand. Always available.

Each bean event takes filters, with GitHub's glob rules:

Filters
on:
  bean_landed:
    beans: ["*", "!fix-*"]       # bean names
    authors: ["ada"]             # who pushed
    paths: ["src/billing/**"]    # files the landing changed
  • beans: and authors: work on the events that name a bean, so not on stalk_moved, stalk_reset or validation_red. paths: works on bean_landed and bean_reverted only, because only those name one commit whose diff is the change. A landing that changes nothing under the paths never starts the automation. Gitstalk reads up to 200 changed files to decide. When it cannot read them (more than 200, or a commit without a parent), the automation starts anyway.
  • An automation never fires on its own beans. It runs one at a time: a trigger that arrives while it runs waits, and a newer one replaces it.

Models

Set model: to one of these, or leave it out for the default. Calls go through the gateway and AI Gateway, which charge each call to the run and the repository. Prices are Workers AI list prices in US dollars per million tokens, as read on 9 October 2026.

Model Input Output
@cf/moonshotai/kimi-k2.7-code (default) $0.95 $4.00
@cf/moonshotai/kimi-k2.6 $0.95 $4.00
@cf/openai/gpt-oss-120b $0.35 $0.75
@cf/openai/gpt-oss-20b $0.20 $0.30
@cf/zai-org/glm-5.3 $1.40 $4.40
@cf/zai-org/glm-5.3-flash $0.15 $0.50
@cf/qwen/qwen3.8-27b $0.45 $3.20
@cf/deepseek-ai/deepseek-v4-pro-0813 $1.32 $3.96
@cf/deepseek-ai/deepseek-v4-flash-0731 $0.44 $1.32

What a run gets

  • A container of its own: each run is one GitHub Actions job on the same Linux container, with git, Node and Python, the repository checked out at the stalk, and the event payload at $GITHUB_EVENT_PATH. It is destroyed when the run ends. Prompt and Shell both run there; see Runners.
  • Memory: restored at the start and committed back at the end, up to 50 MiB. Anyone who can read the repository can read it, so never store a secret there. A run whose memory is over the limit does not save it. Set memory: false to turn it off.
  • An agent with shell, file and git tools. Its model calls go through Gitstalk, which applies the run's and the repository's spend caps.
  • Its own identity, <name>[automation]. With permissions: beans: write it may push bean/*. Those beans go through the pre-land check like anyone's. It can never push to the sprout, the stalk or main.
  • Secrets named in secrets:, by the same rule as Actions. Scheduled and manual runs get them. Runs started by a bean event get only the secrets marked available to pre-land checks, because the event carries text anyone with push access wrote. Values are masked in the log.

Limits

Limit Hosted beta
Run timeout (timeout-minutes) 30 minutes by default, at most 60
Model turns (max-turns) 40 by default
Spend per run (max-cost-usd) $0.50 by default, at most $5
Spend per repository $10 per month
Container minutes Shared with GitHub Actions: 100 per repository per month
Memory 50 MiB

A larger timeout-minutes is capped, and the file's report says so. Every number is in Limits and plans.

Not yet planned

  • Gitstalk tools for the agent, such as comments and decision cards.
  • Your own model keys, and other agents such as Claude Code as a harness.
  • Webhooks into an automation.
  • A browser editor for .github/workflows files. Automations have one.

Build one in the browser

New automation on the Automations tab opens a form beside the file's YAML. See Automation builder and templates.

Compatibility with the Beanstalk name

Gitstalk was called Beanstalk until 10 October 2026. Automations in .beanstalk/automations/ keep running and are listed beside those in .gitstalk/automations/. When both folders hold a file of the same name, the one in .gitstalk/ wins. The builder saves new automations to .gitstalk/automations/ and edits a file where it is. Runs set the BEANSTALK_* twin of each GITSTALK_* variable that existed before the rename (event, automation, actor, memory), and the event payload carries the same object under gitstalk and beanstalk, so older scripts keep working.

Sources