Metadata
Read TaskBot and agent details.
API zw.getTaskbotInfo(), zw.getAgentInfo()
const taskbotInfo = await zw.getTaskbotInfo();
await zw.log("variables", taskbotInfo.variables);
const agent = zw.getAgentInfo();
await zw.log("agent version", agent.version);At a Glance
async/sync*
zw.getAgentInfo()→ returns{ version: string, type: "API_KEY" | "DEFAULT" | "GUEST", id: string | null }(id isnullif thetype: "GUEST").async/sync*
await zw.getTaskbotInfo()→ returns:{ id: number, name: string, // TaskBot name runType: "immediate" | "scheduled" | "webhook", currentRunResult: "success" | "warning" | "error" | "manually_stopped", variables: { ref_id: number, variableNames: string[] }, tables: Array<{ ref_id: number, name: string, type: "G_SHEETS" | "ZW_NATIVE", columnNames: string[] }>, webhookURL: string | null, }
*async in browser, sync locally (see Local vs. Browser Execution).
Examples
Branch behavior by run type
Get tables by type
Add webhook URL to state and reuse later
Notes
Column/vatiables names, not values. For tables and variables, metadata returns names (variable names and column names). To read values, use
zw.getRef().Async behavior. In the browser,
zw.getTaskbotInfo()is async — useawait. When Write JS code runs locally,awaitis optional (examples useawaitfor consistency).zw.getAgentInfo()is sync everywhere.
Last updated
Was this helpful?