We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0055c05 commit b96ddfdCopy full SHA for b96ddfd
references/hello-world/src/trigger/example.ts
@@ -68,3 +68,21 @@ export const maxDurationParentTask = task({
68
return result;
69
},
70
});
71
+
72
+export const batchTask = task({
73
+ id: "batch",
74
+ run: async (payload: { count: number }, { ctx }) => {
75
+ logger.info("Starting batch task", { count: payload.count });
76
77
+ const items = Array.from({ length: payload.count }, (_, i) => ({
78
+ payload: { message: `Batch item ${i + 1}` },
79
+ }));
80
81
+ const results = await childTask.batchTriggerAndWait(items);
82
83
+ return {
84
+ batchCount: payload.count,
85
+ results,
86
+ };
87
+ },
88
+});
0 commit comments