Runs your workflows durably, start to finish.
AutoFlow runs a small Starlark program as a durable workflow. The workflow calls APIs, enforces policies, waits for people and coordinates across projects. Every step is recorded, so after a crash or a restart the workflow resumes from its history.
load("module:policy", "evaluate", "REQUIRE_APPROVAL", "ALLOW")
load("module:gitlab", "call_api", "post_value")
def main(w, project_id, environment, token):
headers = {
"Authorization": "Bearer " + token,
"Content-Type": "application/json",
}
decision = gather(evaluate(
trigger = "com.gitlab.deploy.requested",
resource = "projects/%d/environments/%s" % (project_id, environment),
))
if decision["verdict"] == REQUIRE_APPROVAL:
reply = channel()
gather(post_value(
"/api/v4/projects/%d/deploy_approvals" % project_id,
value = {"environment": environment, "reply": reply},
headers = headers,
))
if gather(reply, timeout = 3 * 24 * time.hour) != "approved":
fail("deployment not approved")
elif decision["verdict"] != ALLOW:
fail("deployment denied by policy")
status, _, _, err = gather(call_api(
"POST",
"/api/v4/projects/%d/deployments" % project_id,
headers = headers,
body = json.encode({"environment": environment}),
))
return statusRecorded history
- Workflow created
- Policy evaluation scheduled
- Policy evaluation completed: approval required
- Approval request scheduled
- Approval request completed: posted to GitLab
- Waiting for the answertimer started for 3 days, holding no resources
- Channel value received: approved
- Deployment call scheduled
- Deployment call completed: status 201
- Workflow completed
Durable
Every step is recorded. After a crash or a restart, a workflow resumes from its history instead of starting over.
Sandboxed Starlark
No I/O, no wall clock, no randomness inside the script. Every side effect is a module action that AutoFlow runs and records.
Governed
A workflow asks the policy module for a verdict before it acts: proceed, stop, or hand the decision to a person and wait for the answer.
Extensible
Modules add actions over gRPC and protobuf, in any language; a Go SDK is provided. Built in today: gitlab, policy, event and gitlab-function.
How it works
Write a workflow definition
A short Starlark program with a main function that loads modules and gathers the results of their actions.
Start it over gRPC
Call StartWorkflow on AutoFlow’s gRPC API with the definition and its arguments.
AutoFlow runs it on autocore
Everything the workflow does outside the interpreter is recorded in its history, so it resumes from that history after a restart or a failure.
Interact with it while it runs
Read its state and result, send it values or cancel it through the same gRPC API.
Where it stands
AutoFlow is available to GitLab teams through the gRPC API today, and a local try-out runs on Caproni: one fragment deploys it next to GitLab, as Get started shows. The roadmap is in the Theseus epic. The status page lists what works today and what is planned.
What it is
What AutoFlow is, what it is for and how it compares with GitLab CI/CD and the Duo Agent Platform
Read the overviewHow it works
The layers under a workflow, crash and replay, and what AutoFlow guarantees
Read the deep dive