Private preview. Daggry is not publicly released.Roadmap
Skip to content

Run your first workflow ​

Reading about a signed trail is not the same as checking one yourself. On this page you run a small workflow, approve it and verify its evidence trail, in about ten minutes. After each command, the page names the records Daggry sealed. Read it if you have a running Daggry. If you do not, start with Install Daggry.

The workflow has no agent step, so you need no model credential. You write one file and run four commands. The example is software: the workspace is a Git repository and the work item is an issue. The commands and outputs on this page are illustrative. Placeholders in angle brackets, such as <owner>, stand for values you choose.

Before you start ​

You need the daggry CLI and two environment variables that point it at your Daggry. Install Daggry sets both.

You also need a scratch repository on GitHub with one open issue, with the Daggry GitHub App installed on it. A run pushes a branch named daggry/<run-id> to it, so do not use a repository you care about.

Check that the CLI is ready.

sh
daggry --help

Start a run ​

A run needs three things: a workflow, a workspace and an objective, which says what the run is asked to do. Here the objective is an issue.

  1. Save this workflow as first.yaml. It runs a command, waits for your approval, and runs a second command.

    yaml
    format: daggry/workflow@1
    steps:
      - id: build
        kind: command
        scope: anywhere
        run: [sh, -c, "echo hello > hello.txt"]
      - id: review
        kind: human
        of: build
      - id: finish
        kind: command
        scope: anywhere
        run: [sh, -c, "echo done > done.txt"]

    run is the command: a program and its arguments, as a list. scope is the paths a step can write. anywhere allows every path except a protected path.

    WARNING

    This page shows the design. The built binary differs in a few places, such as the format header, which it does not read yet, and a run that it reads as one shell line. See Build status and Names the binary still uses.

  2. Start the run. Name the repository as <owner>/<name> and the issue by its URL.

    sh
    daggry run --workflow first.yaml --workspace <owner>/<name> --item https://github.com/<owner>/<name>/issues/<n>

    The command prints the run ID. Daggry has already sealed the first two records of the run: a run lock, which pins what the run started under, and the work item, which holds the objective: the title and the body of your issue.

    text
    run-0123456789abcdef
  3. Read the state of the run.

    sh
    daggry status run-0123456789abcdef --json
    json
    {"state":"waiting","attempts":[{"job":"main","n":1,"state":"waiting"}],"waiting_for":"approval"}

If daggry run fails with refused: ..., the text after the colon names the cause. See the CLI reference.

Approve it ​

The run has stopped because the workflow asks for your approval at the review step.

  1. List what Daggry sealed so far.

    sh
    daggry logs run-0123456789abcdef
    text
    daggry/run-lock@1 run-lock control 7d3b0c91a4e2
    daggry/work-item@1 work-item control c94c24f1751a
    daggry/change@1 change-1 control 2019b48c668e

    Each line is one record, and the last column starts its digest. The first two records open every run. When the build step ended, Daggry sealed change-1: the commit the step made and the paths it changed.

  2. Approve the run.

    sh
    daggry approve run-0123456789abcdef

    The command prints nothing and exits with 0. Daggry seals your approval, bound to the digest of change-1, and the job continues in a new runner. The finish step then seals a second change. Run daggry status again, and state becomes succeeded. The run also pushed its commits to the branch daggry/run-0123456789abcdef.

Verify the trail ​

You do not have to trust the run: check its trail.

  1. Verify everything Daggry sealed for your tenant.

    sh
    daggry verify
    text
    verified 9 entries, 1 blobs

    An entry is a record. The command computes every digest and signature again on your machine. If anything does not match, it exits with 1 and prints a reason. To read a failure, see Verify a run.

You have started a run, approved it and verified its trail. To put an agent to work, add an agent step that names a persona: see Write a workflow.

Next: Configure Daggry

Sponsored by