A Task is a resumable unit of a Run that can be retried, resumed and is logged. Integrations use Tasks internally to perform their actions.

The wrappers at io.integration.runTask() expose the underlying Integration client as the first callback parameter (see examples on the right). They will have defaults set for options and onError handlers, but should otherwise be considered identical to raw io.runTask().



Should be a stable and unique key inside the run(). See resumability for more information.


The callback that will be called when the Task is run, this is where your logic should go. The callback receives the Task and the IO as parameters.


The options of how you’d like to run and log the Task.


An optional callback that will be called when the Task fails. You can perform logic in here and optionally return a custom error object. Returning an object with { retryAt: Date, error?: Error } will retry the Task at the specified Date. You can also just return a new Error object to throw a new error. Return nothing to rethrow the original error.


A Promise that resolves with the returned value of the callback.

If the remote callback feature options.callback is enabled, the Promise will instead resolve with the body of the first request sent to task.callbackUrl.

  id: "alert-on-new-github-issues",
  name: "Alert on new GitHub issues",
  version: "0.1.1",
  trigger: github.triggers.repo({
    event: events.onIssueOpened,
    owner: "triggerdotdev",
    repo: "trigger.dev",
  integrations: {
  run: async (payload, io, ctx) => {
    const response = await io.github.runTask(
      async (client) => {
        //create a project card using the underlying GitHub Integration client
        return client.rest.projects.createCard({
          column_id: 123,
          note: "test",
      //this is optional
      { name: "Create card", icon: "github" }

    //log the url of the created card
    await io.logger.info(response.data.url);