Skip to content
Technical preview. This site is published for review. Everything on it, including the API, tokens and module protocol, is subject to change.

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.

deploy_approval.star - An AutoFlow workflow with Human-in-the-loop
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 status

Recorded history

  1. Workflow created
  2. Policy evaluation scheduled
  3. Policy evaluation completed: approval required
  4. Approval request scheduled
  5. Approval request completed: posted to GitLab
  6. Waiting for the answertimer started for 3 days, holding no resources
  7. Channel value received: approved
  8. Deployment call scheduled
  9. Deployment call completed: status 201
  10. 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

  1. Write a workflow definition

    A short Starlark program with a main function that loads modules and gathers the results of their actions.

  2. Start it over gRPC

    Call StartWorkflow on AutoFlow’s gRPC API with the definition and its arguments.

  3. 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.

  4. 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 overview

Run a workflow

Start a workflow over gRPC and read its result, in about ten minutes

Get started

How it works

The layers under a workflow, crash and replay, and what AutoFlow guarantees

Read the deep dive