Get the context of a task run.
import { task } from "@trigger.dev/sdk/v3";
export const parentTask = task({
id: "parent-task",
run: async (payload: { message: string }, { ctx }) => {
if (ctx.environment.type === "DEVELOPMENT") {
return;
}
},
});
ctx
) is a way to get information about a run.
ctx.run.durationMs
will be fixed at the moment the run()
function is called.import { task } from "@trigger.dev/sdk/v3";
export const parentTask = task({
id: "parent-task",
run: async (payload: { message: string }, { ctx }) => {
if (ctx.environment.type === "DEVELOPMENT") {
return;
}
},
});
Show properties
Show properties
run()
function is called. For live
values use the usage SDK functions.run()
function is called. For live values use the
usage SDK functions.run()
function is called. For live values
use the usage SDK functions.Show properties
PREVIEW
then this will be the branch name.Show properties
Show properties
import { task } from "@trigger.dev/sdk/v3";
export const parentTask = task({
id: "parent-task",
run: async (payload: { message: string }, { ctx }) => {
if (ctx.environment.type === "DEVELOPMENT") {
return;
}
},
});