Overview
Thectx object provides workflow control methods that help you manage execution timing and optimize resource usage.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Orchestrate execution with sleep and halt
ctx object provides workflow control methods that help you manage execution timing and optimize resource usage.
ctx.sleep(milliseconds: number): Promise<void>
await ctx.sleep(1000); // Sleep for 1 second
ctx.halt(reason?: string): void
halt() should only be used AFTER expensive operations when the result disqualifies the entire row. Don’t use it for simple validation or early returns.const analysis = await services.ai.generateObject({
prompt: `Analyze if ${companyName} is in our ICP`,
schema: z.object({ isICP: z.boolean() }),
});
if (!analysis.object.isICP) {
ctx.halt("Not in ICP");
return false;
}