Your first automationLesson 4 of 8

Output, logs and run history

A green status says the script finished; it does not say it did the right thing. The answer is in what main returned — the Output — and, when something looks off, in what it printed — the Logs. Both are kept with every run, so you can come back to a run from last week and read exactly what happened.

What you will learn
  • Read the Output as JSON or as a table
  • Use logs for diagnosis, never as the result
  • Find a run again in Run history and on the Runs page

Output is the answer, logs are the story

The Output is the value main returned (in C and C++, the JSON passed to waiso_set_result / waiso::setResult). It is what a flow’s next step receives, what an API caller gets back and what the Runs page stores. The Logs are everything the script printed — print, console.log, printf — plus system lines such as start and finish, each with a time and a level.

RunsEvery script and flow run in this project
Live
Search name or value · amount>100Ctrl KToday7 days30 daysAll time
Kind: AllStatus: AllWaiting for you 1
campaignFlowTriggered byScheduleDuration713msRan at5 h agoStatusSuccess
load_customersstep 1 of campaignTriggered bycampaignDuration38msRan at5 h agoStatusSuccess
send_offer ×4step 2 · loopTriggered bycampaignDuration188msRan at5 h agoStatusSuccess
approvalFlowTriggered byana@shop.devDuration174msRan at5 h agoStatusWaiting
report.pyTriggered byScheduleDuration6.7sRan at4 h agoStatusSuccess
broken.pyTriggered byana@shop.devDuration877msRan at26 min agoStatusFailed
The Runs page: every run of the project, with who started it, how long it took, when and how it ended.

Read the last run

  1. Check the Output

    Run daily-report again and stay on Output. The result is shown as formatted JSON; the toolbar switches between JSON view and Table view, and offers Copy JSON, Download JSON and an expand button for long results. The duration beside it runs from the worker claiming the job to the result.

  2. Read the Logs

    Open Logs. You see 3 scores, 2 passed between the system lines. Filter by level or use Search logs when a run prints a lot.

  3. Find it on the Runs page

    Click Runs in the left column. Your run is the top row: daily-report, Triggered by your e-mail, its Duration, Ran at and a Success status. Click the row: a drawer opens with its Data (inputs and output), Logs and the Code that ran.

Return structure, get a table

Return data, not sentences. An object or a list of objects can be read field by field by a flow, filtered on the Runs page and shown as a table. A list of objects opens straight in Table view, with a search box, sortable columns and a CSV export. Change daily-report to return one row per score:

daily-report.ts
export async function main(passing: number = 80) {
  const scores = [85, 92, 78]
  const rows = scores.map((score, i) => ({ student: i + 1, score, passed: score >= passing }))
  console.log(`${rows.filter((r) => r.passed).length} of ${rows.length} passed`)
  return rows
}
Expected outputSuccessThree rows, shown as a table
#

Two places to find a run

WhatRun history (editor)Runs page
ShowsThis script’s runsEvery run of the project: scripts, flows, scrapers, from any trigger
Best forGoing back to a run while you editSeeing what ran, when, and why it failed
ActionsOpen this run (its code and output), Restore inputsFilter by status, kind, dates, text and input values; open the drawer

Viewing an old run

Opening a run from Run history puts the editor in Viewing history: the code shown is the code that ran then, and the Output is that run’s. Back to current returns to your draft. Restore inputs copies that run’s values into the Inputs card, which is the quickest way to reproduce a failure.

4 / 8