Agent workflows

Unattended Agent Workflows Powered by Relay

How this guide is prepared

Send task instructions and input files to Relay, then close your laptop.

An always-on host discovers the task on its next check. Its Agent reads the handoff note and task document, then starts work. When finished, it sends the outputs, logs and result summary back through Relay.

When you open your computer again, collect the results and take the next step.

Once you configure this workflow, tasks can be received, executed and returned unattended. Relay hands off files and context, cron on the host triggers the checks, and your Agent works within the scope you agreed in advance.

Use an always-on host to execute tasks

This workflow needs an always-on host that can run an Agent. It could be your workstation, home server or a remote machine you have already configured.

Prepare the host’s Relay CLI session, target workspace and Agent environment first. Then choose where tasks arrive and results return. For example, use these folders in one workspace:

  • /tasks: tasks waiting for the host to process.
  • /results: results returned by the host.

The host checks only the agreed task folder. The device that submitted the work can collect the results later.

On a Linux host, cron can start your inbox-checking script on a schedule, for example every five minutes. Work starts after a later check discovers the task. Choose an interval that fits your workflow. cron configuration reference

Send a task with clear instructions

Unattended execution needs instructions that let the Agent begin. To run an evaluation and prepare its results, you could deliver this directory:

task/
├── TASK.md
├── inputs/
└── config.json

The task document explains the goal, inputs, how to run the work and completion criteria. It can also specify scope, a maximum runtime and what to do if inputs are missing. For work handed on in stages, we recommend HANDOFF.md to record progress and next actions; an existing TASK.md can serve the same purpose.

The handoff note gives the Agent a short entry point:

Read TASK.md first, then use inputs/ and config.json to run this evaluation. Prepare the metrics, run log and result summary, and return the outputs to /results.

For example, send it with the CLI:

relay bundle push ./task --add-folder /tasks --note "Read TASK.md first, run the evaluation and prepare the results, then return the outputs to /results."

Keep the sender connected until upload and publication succeed. The host can then receive the handoff independently, and your laptop can go offline.

Read the context before starting work

On each scheduled check, your execution script reads the inbox for the task folder:

relay bundle inbox --folder /tasks --json

The JSON output includes complete notes. The execution script selects a Bundle, saves its ID and note locally, then downloads the files into that task’s own directory. If relay bundle pull --help lists --save-note, the script can also add that flag to keep the full note as RELAY_NOTE.md beside the received files. JSON then includes note and notePath.

The receiving Agent follows the Relay Skill and reads the note in full. If it names TASK.md or another handoff document, the Agent reads that document in full before starting work under the task requirements you configured.

In the evaluation example, the Agent can check that inputs are present, run the agreed evaluation, analyze its output and prepare deliverables against the completion criteria. If inputs are missing or work cannot continue, it retains a problem description and logs for follow-up.

The instructions should explain how to establish completion. After running the evaluation, for example, the Agent needs to check the output files, record failures and produce a summary for review.

Return the outputs with a result summary

When the Agent finishes, it can organize the deliverables like this:

outputs/
├── SUMMARY.md
├── metrics.csv
└── run.log

SUMMARY.md explains what was processed, which checks passed and which questions still need review.

The execution script then pushes the outputs to Relay and links the original task in the note:

relay bundle push ./outputs --add-folder /results --note "Task <task Bundle ID> is complete. Metrics and logs are attached; see SUMMARY.md for findings and items to review."

The host records the task as delivered only after the result Bundle is successfully published.

When you next come online, check the /results inbox, read the result note and collect the files. The returned context helps you decide whether to review, continue the analysis or send another task.

Keep receiving tasks after each handoff

This approach fits work with clear inputs and deliverables: running evaluations, processing data, generating reports or analyzing a batch of materials.

Prepare the task files and describe the goal and deliverables. The always-on host checks its inbox, runs your Agent and returns the outputs with instructions for the next step.

Your laptop can go offline after sending the task. The host keeps working, and the next handoff brings results and fresh context for you to pick up later.

Try a handoff