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
reliantCLI, 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:Run it once from the terminal to check it and let the machine sync it:It stops at the question; answer it with
.reliant/workflows/release-check.yaml
terminal
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
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
0. Answer Hold instead and the run still completes, but at a node that declares failure: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: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.Pendingreports 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:startandruns:readcover starting and reading runs;Follow,GatesandTriggers.Fireneedreliant:api.
Troubleshooting
runs.start …: at least one user message or attachment is required
runs.start …: at least one user message or attachment is required
Set
Message on StartRun, even for a workflow that reads only its inputs.PermissionDenied (scope_missing)
PermissionDenied (scope_missing)
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 workflow is not found, or the run is in another project
The workflow is not found, or the run is in another project
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.