Subscribe to repository lifecycle events in Artifacts
Cloudflare Artifacts event subscriptions expose repository lifecycle changes as notifications you can consume in a Worker. That gives you a clean hand-off for automation that reacts to repository creation, imports, and pushes without inventing a separate watcher.
The event model is split across two sources. Account-level artifacts events cover lifecycle changes such as repo.created, repo.deleted, repo.forked, and repo.imported. Repository-level artifacts.repo events cover activity such as pushed, cloned, and fetched. That split matters because it keeps provisioning events separate from day-to-day repository traffic.
Wire Artifacts events into a Worker through Queues
Queues sits in the middle and carries the event notifications into a Worker for processing. That is the part that turns Artifacts from a source of notifications into a usable automation path. The Worker can then decide whether to start a build, create follow-up work, or ignore the event altogether.
For a repository creation or import event, the Worker can kick off the first bit of setup: initialise a build, register the repo in a downstream system, or create a review task. For push events, the same path can trigger a build and deploy step, or hand the change to an agent that checks the commit before anything else moves.
The main constraint is noise. Repository activity can be busy, and not every event deserves the same treatment.
Choose the right event source for repo.created, repo.imported, and repo.pushed
repo.created and repo.imported belong at the account level because they describe repository lifecycle changes, not routine content changes. They are the events you use when something new enters the system and needs first-time handling. repo.pushed sits with repository activity and is the better fit for commit-triggered automation.
That boundary keeps the logic sane. If a workflow needs to run once when a repository appears, bind it to repo.created or repo.imported. If it needs to react to content changes, listen for repo.pushed and leave the lifecycle path alone. Mixing the two leads to duplicate work and very odd build behaviour.
repo.deleted and repo.forked are useful in the same account-level stream when the automation cares about cleanup or inheritance. The repository-level cloned and fetched events are more operational than developmental, so they suit logging, auditing, or rate-sensitive handling rather than build triggers.
Build commit-driven automation without overreacting to every push
Commit-driven automation works best when the push is a signal, not a command. A push can mean a useful change, a housekeeping commit, a mirror sync, or an agent making a noisy adjustment. Treating every push as a build is how you end up with a queue full of work nobody asked for.
A better pattern is to make the Worker inspect the event and apply a narrow rule before it starts anything expensive. If the repo change lands on a branch that should deploy, continue. If it is a draft branch, a dependency update, or a non-deploying path, stop there. The subscription gives you the trigger, but the Worker still needs to act like a filter.
That is also where review agents fit cleanly. A push can trigger a review pass without starting a full deployment, which keeps faster checks separate from heavier release steps. The same event can drive different outcomes depending on branch, path, or repository role.
Keep the subscription path predictable when the repo changes
The subscription path stays easier to reason about when each event source has one job. Lifecycle events handle onboarding and structural changes. Repository events handle commits and activity. A Worker should map those to distinct branches in the automation logic so a repo import does not look like a code change.
Predictability also depends on staying close to the source of truth. If a repository moves from first import to active pushing, the automation should not need a rewrite. The event source already gives you the boundary: setup on repo.created or repo.imported, commit handling on repo.pushed, and lighter operational handling for the rest.
That makes the subscription useful without being clever about it. The automation follows the repository’s state, and the state change tells you which path to run.




