Debug Events
Use flo.task.emitEvent(...) to append structured events to the current task timeline.
Example:
await flo.task.emitEvent({
event_type: "orders.sync.started",
title: "Sync started",
message: "Fetching latest order batch",
level: "info",
payload: {
shop_id: "acme",
page: 1,
},
});
Recommended Event Shape
event_type: stable machine-readable identifiertitle: short human-readable labelmessage: one-line progress updatelevel:info,warning, orerrorpayload: extra structured debug context
When To Emit Events
Emit events at boundaries that help explain tool behavior:
- external API request started
- expensive step completed
- retry branch taken
- validation failure
- child batch created or resumed
Avoid emitting noisy events for every trivial line of execution.
Local Testing
In the local Node preload shim, flo.task.emitEvent(...) writes the request to console.log. That makes it useful for smoke tests without requiring the full runtime.
Next: Vault