Runs your workflows durably, start to finish.
AutoFlow turns a small Starlark program into a durable workflow. Call APIs, enforce policies, wait for people, coordinate across projects: every step is recorded, so the workflow picks up exactly where it left off, whatever happens in between.
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: the same gRPC API covers the workflow’s whole lifecycle.
Where it stands
AutoFlow is available to GitLab teams through the gRPC API today. A local try-out via Caproni is coming; the roadmap lives in the Theseus epic. The status page lists what works today and what is planned.