Tela SDK for JavaScript
    Preparing search index...

    Function extractTaskOutput

    • Extracts the output content of a task regardless of whether it came from a canvas execution or a workflow execution.

      • Canvas tasks store the result under outputContent.content.
      • Workflow tasks may nest it under outputContent.output.output in some legacy shapes; this helper handles both.

      Returns null if the task has no output yet (e.g. still running).

      Type Parameters

      • T = unknown

      Parameters

      • task: Pick<Task<T>, "outputContent">

      Returns T | null

      const task = await tela.tasks.get(id)
      const result = extractTaskOutput<MyOutput>(task)