Skip to main content
By the end of this guide, a small Go program starts a Reliant workflow, streams its progress, asks a person the question the run is waiting on, and exits 0 or 1 with the run’s verdict. It then fires an automation the same way. The Go SDK is the client the reliant command’s own run supervision is built on, so anything it shows in the terminal your service can act on.

Before you begin

  • The reliant CLI, v1.21 or later, signed in (Sign in and tokens), on a computer with a browser to approve a token.
  • Go 1.27 or newer.
  • A Reliant project on a connected machine. The workflow below needs no model, so it runs in any organization.
1

Add a workflow that asks a question

In the project, add a workflow that asks whether a release may ship and ends passed or failed on the answer:
.reliant/workflows/release-check.yaml
Run it once from the terminal to check it and let the machine sync it:
terminal
It stops at the question; answer it with reliant workflow answer <execution-id> --select Hold, or in the app.A run you start from code without a session is hosted in the project you used most recently, and a saved workflow’s name is looked up there. Running it from this project makes it that project. To run in a chosen conversation instead, pass its SessionID.
2

Create a token

terminal
You approve it in the browser, or with a device code. It prints an rlat_ token once, acting as you for 90 days. Following a run and answering its questions need the whole API (reliant:api), which this token has. A service that only starts runs and checks them with Runs.Get can take a narrower one, --scope runs:start (Scopes).
3

Write the program

terminal
main.go
Runs.Start returns as soon as the run is dispatched. StopOnGate ends each follow when the run opens a question, and Gates.Pending returns its prompts. The answer is exactly what the person typed: the SDK never picks an option for you, and has no call that decides an approval.
4

Run it and read the verdict

terminal
It exits 0. Answer Hold instead and the run still completes, but at a node that declares failure:
and it exits 1. Always branch on Succeeded, which combines status and outcome; status alone would call this run a success.
5

Fire an automation

Triggers.Fire runs a saved automation now, by name or ID. Firing is asynchronous, so look for its event, then follow the session it launched. Take the loop from Fire a trigger; here it fires a disabled nightly schedule of the same workflow:
The run failed because an automation’s run has nobody to ask: its question resolves at once with no answer, so it ends at held. Workflows you fire this way should not depend on a person (Unattended by design).
6

Revoke the token when you are done

terminal

What this does not do

  • It can’t approve. Gates.Pending reports an approval so you can page someone, but deciding it takes a person in the app (Who can decide an approval).
  • It can’t enable, create or edit automations. The SDK reads and fires triggers only.
  • No narrow token for following. runs:start and runs:read cover starting and reading runs; Follow, Gates and Triggers.Fire need reliant:api.

Troubleshooting

Set Message on StartRun, even for a workflow that reads only its inputs.
The token was created with --scope and lacks what this call needs (ErrPermissionDenied). Create it again without --scope, under the same --name to replace it.
The headless run went to your most recently used project. Run the workflow once from its project, or pass SessionID.

Next steps

Stream a run in TypeScript

Show the same run live in a frontend, with resume.

Run a workflow from GitHub Actions

The same start-and-follow from CI, with the CLI.

Go SDK reference

Every call: listing runs, steering, webhooks and errors.

Require human approval

Approvals and questions inside a workflow.