Task-specific setup is being clarified in the developer documentation. Developers can reference how to configure when specific tasks require dedicated setup routines or scoped locals.
The updated guide details the middleware option available within a task definition. It clarifies the execution pipeline: task-level middleware executes after global middleware but before the primary run function. Code snippets across the overview page are also being updated to use standard TypeScript syntax highlighting strings.
Here is how you would configure it:
typescript
1export const myTask = task({2 id: "my-task",3 middleware: async ({ next }) => {4 // Setup specific to this task5 await next();6 },7 run: async (payload) => {8 // Main task execution9 },10});
This analysis will evolve. Full story with review threads and final assessment available after merge.