Triggering Task Runs

Kick off runs of registered workflow tasks.

Triggering a task run from within another task?

Use instead of the methods below. For details, see Chaining task runs.

After you create a workflow and register , you can start triggering of those tasks from your own apps and agents.

You can also manually trigger runs in the Render Dashboard and CLI to help with testing and debugging.

First: Create an API key

Triggering task runs from code requires a Render API key.

Create an API key with these steps, then return here.

Running with the Render SDK

The Render SDK is currently available for TypeScript and Python.

SDKs for additional languages are planned for future releases. To execute tasks from other languages, use the Render API.

Follow these steps to execute from your code using the Render SDK.

1. Install the SDK

From your TypeScript project directory:

(Or pnpm install, bun add, etc.)

If you already have the SDK installed, make sure you're using version ^1.0 or later:

After installing, make sure @renderinc/sdk is listed as a dependency in your package.json file at version ^1.0 or later.

2. Set your API key

In your application's environment, set the RENDER_API_KEY environment variable to your API key:

The SDK client automatically detects and uses the value of this environment variable.

Alternatively, you can provide your API key explicitly when initializing the client (see the SDK reference for your language).

3. Initialize the client and trigger a run

The following code demonstrates initializing the SDK client, triggering a task run, and waiting for the run to complete. See below for more details.

You trigger a task run by calling the client's workflows.startTask method. This method takes the following arguments:

ArgumentDescription

taskIdentifier

The slug indicating the task to run, available from your task's page in the Render Dashboard:

Task slug in the Render Dashboard

Every task slug has the following format:

For example: my-workflow/calculate_square

inputData

An array containing the task's input arguments. Elements are positional based on the task's function signature.

The calculate_square task in the example above takes a single integer argument, provided as the single element of an array.

For tasks that take zero arguments, provide an empty array, [].

The workflows.startTask method returns a TaskRunResult as soon as the run is created. This object provides the run's taskRunId immediately. You can call await result.get() to wait for the run to complete and obtain the full task run details (including status and results).

For full options and details, see the TypeScript SDK reference.

Running with the Render API

The Render API provides an endpoint for triggering task runs, along with a variety of endpoints for retrieving workflow and task run details. The Render SDK uses the Render API behind the scenes, and you can also use it directly from your own code.

Start a task run by sending a POST request to the Run task endpoint. The JSON body for this request includes two properties:

PropertyDescription
task

Required. An identifier specifying the task to run.

You can provide either of two identifiers, both of which are available from your task's page in the Render Dashboard:

Task slug in the Render Dashboard

  • The task's slug
    • This has the format {workflow-slug}/{task-name} (for example, my-workflow/calculate_square)
  • The task's ID
    • This has the format tsk-abc123...
input

Required. An array or object containing values for the task's input arguments.:

  • If you provide an array, elements are positional based on the task's function signature.
  • If you provide an object, each key maps to a parameter name in the task's function signature.

For a task that takes zero arguments, provide an empty list, [].

Running manually

You can manually trigger task runs directly from the Render Dashboard and CLI. This is handy for testing and debugging new tasks.

Running tasks manually in the Render Dashboard

  1. From your workflow's Tasks page in the Render Dashboard, click a task to open its Runs page.

  2. Click Start Task in the top-right corner of the page:

    Running a task in the Render Dashboard

    A dialog appears for providing the task's input arguments:

    Providing input arguments for a task run in the Render Dashboard

  3. Provide the task's input arguments as a JSON array. Each array element maps to the task's corresponding positional argument.

    For example, you can provide [5] for a task that takes a single integer argument, or [] for a task that takes zero arguments.

    You can click Format and Validate to cleanly structure your input and confirm that it's valid JSON.

  4. Click Start task.

    Your new task run appears at the top of the Runs table.