Start a run

Start a run of a task from Studio, the CLI or the API, then read its status and output.

Before you start

You need a task. See Write a task.

Start a run

  1. Sign in to the CLI.
  2. Set PROJECT_ID to your project's ID (Find your IDs): export PROJECT_ID=<id>.
  3. Start the run. The --idempotency-key makes a retry return the same run:
    Shell
    npx veryfront project runs create --idempotency-key word-count-1 --json --body '{  "project_id": "'$PROJECT_ID'",  "target": { "type": "task", "id": "word-count" },  "input": { "text": "Veryfront runs agents, tasks and workflows" }}'
  4. Set RUN_ID to data.run_id in the answer: export RUN_ID=<run_id>.
  5. Read the run until its status is completed. You should now see "words": 6 in its output:
    Shell
    npx veryfront project runs get --run-id $RUN_ID --json

Try it in a sandbox

  1. Add the word-count task

  2. Set PROJECT_ID

  3. Start the run

  4. Set RUN_ID

  5. Wait until it is completed

  6. Check it

Try it out

Next steps