Logging — api.log()
api.log() writes messages that appear in the DEBUG output of the test runner and in run history details. It behaves identically to console.log().
class Workflow { async start(data, headers, api) { api.log('Order received:', data.id); api.log('Customer:', data.email, 'Total:', data.total_price); }}Multiple arguments are joined with a space, the same as console.log.
Console methods
Section titled “Console methods”All standard console methods are also captured:
| Method | Prefix in DEBUG output |
|---|---|
api.log() / console.log() | (none) |
console.info() | ℹ️ |
console.warn() | ⚠️ |
console.error() | ❌ |
Use console.warn() and console.error() to draw attention to recoverable problems and failures respectively. All output appears in the same DEBUG array in the order it was written.
Logging objects
Section titled “Logging objects”Pass objects directly — they are serialised automatically in the output:
api.log('Order details:', { id: data.id, status: data.financial_status });Live runs vs test runs
Section titled “Live runs vs test runs”In live runs, api.log() output is stored as part of the run record and is visible in the Runs panel in the dashboard. In test runs, it appears immediately in the test result panel.
Output is captured per step — each step shows its own DEBUG array.