Files
github-actions[bot] c0b6309c72
🚀 Publish Trigger.dev Docker / units (push) Failing after 4s
🚀 Publish Trigger.dev Docker / typecheck (push) Failing after 20s
🚀 Publish Trigger.dev Docker / publish-webapp (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker-v4 (push) Has been skipped
chore: release v4.4.3 (#3182)
## Summary
2 new features, 2 improvements.

## Improvements
- Add syncSupabaseEnvVars to pull database connection strings and save
them as trigger.dev environment variables
([#3152](https://github.com/triggerdotdev/trigger.dev/pull/3152))
- Auto-cancel in-flight dev runs when the CLI exits, using a detached
watchdog process that survives pnpm SIGKILL
([#3191](https://github.com/triggerdotdev/trigger.dev/pull/3191))

## Server changes

These changes affect the self-hosted Docker image and Trigger.dev Cloud:

- A new Errors page for viewing and tracking errors that cause runs to
fail
  
  - Errors are grouped using error fingerprinting
- View top errors for a time period, filter by task, or search the text
  - View occurrences over time
- View all the runs for an error and bulk replay them
([#3172](https://github.com/triggerdotdev/trigger.dev/pull/3172))
- Add sidebar tabs (Options, AI, Schema) to the Test page for schemaTask
payload generation and schema viewing.
([#3188](https://github.com/triggerdotdev/trigger.dev/pull/3188))

<details>
<summary>Raw changeset output</summary>

# Releases
## @trigger.dev/build@4.4.3

### Patch Changes

- Add syncSupabaseEnvVars to pull database connection strings and save
them as trigger.dev environment variables
([#3152](https://github.com/triggerdotdev/trigger.dev/pull/3152))
-   Updated dependencies:
    -   `@trigger.dev/core@4.4.3`

## trigger.dev@4.4.3

### Patch Changes

- Auto-cancel in-flight dev runs when the CLI exits, using a detached
watchdog process that survives pnpm SIGKILL
([#3191](https://github.com/triggerdotdev/trigger.dev/pull/3191))
-   Updated dependencies:
    -   `@trigger.dev/core@4.4.3`
    -   `@trigger.dev/build@4.4.3`
    -   `@trigger.dev/schema-to-json@4.4.3`

## @trigger.dev/core@4.4.3

### Patch Changes

- Auto-cancel in-flight dev runs when the CLI exits, using a detached
watchdog process that survives pnpm SIGKILL
([#3191](https://github.com/triggerdotdev/trigger.dev/pull/3191))

## @trigger.dev/python@4.4.3

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/core@4.4.3`
    -   `@trigger.dev/build@4.4.3`
    -   `@trigger.dev/sdk@4.4.3`

## @trigger.dev/react-hooks@4.4.3

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/core@4.4.3`

## @trigger.dev/redis-worker@4.4.3

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/core@4.4.3`

## @trigger.dev/rsc@4.4.3

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/core@4.4.3`

## @trigger.dev/schema-to-json@4.4.3

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/core@4.4.3`

## @trigger.dev/sdk@4.4.3

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/core@4.4.3`

</details>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-10 10:17:24 +00:00
..
2026-03-10 10:17:24 +00:00
2026-03-10 10:17:24 +00:00

Python Extension for Trigger.dev

The Python extension enhances Trigger.dev's build process by enabling limited support for executing Python scripts within your tasks.

Overview

This extension introduces the pythonExtension build extension, which offers several key capabilities:

  • Install Python Dependencies (Except in Dev): Automatically installs Python and specified dependencies using pip.
  • Requirements File Support: You can specify dependencies in a requirements.txt file.
  • Inline Requirements: Define dependencies directly within your trigger.config.ts file using the requirements option.
  • Virtual Environment: Creates a virtual environment (/opt/venv) inside containers to isolate Python dependencies.
  • Helper Functions: Provides a variety of functions for executing Python code:
    • run: Executes Python commands with proper environment setup.
    • runInline: Executes inline Python code directly from Node.
    • runScript: Executes standalone .py script files.
  • Custom Python Path: In development, you can configure devPythonBinaryPath to point to a custom Python installation.

Usage

  1. Add the extension to your trigger.config.ts file:
import { defineConfig } from "@trigger.dev/sdk/v3";
import { pythonExtension } from "@trigger.dev/python/extension";

export default defineConfig({
  project: "<project ref>",
  build: {
    extensions: [
      pythonExtension({
        requirementsFile: "./requirements.txt", // Optional: Path to your requirements file
        devPythonBinaryPath: ".venv/bin/python", // Optional: Custom Python binary path
        scripts: ["src/python/**/*.py"], // Glob pattern for Python scripts
      }),
    ],
  },
});
  1. (Optional) Create a requirements.txt file in your project root with the necessary Python dependencies.
pandas==1.3.3
numpy==1.21.2
import { defineConfig } from "@trigger.dev/sdk/v3";
import { pythonExtension } from "@trigger.dev/python/extension";

export default defineConfig({
  project: "<project ref>",
  build: {
    extensions: [
      pythonExtension({
        requirementsFile: "./requirements.txt",
      }),
    ],
  },
});
  1. Execute Python scripts within your tasks using one of the provided functions:

Running a Python Script

import { task } from "@trigger.dev/sdk/v3";
import { python } from "@trigger.dev/python";

export const myScript = task({
  id: "my-python-script",
  run: async () => {
    const result = await python.runScript("my_script.py", ["hello", "world"]);
    return result.stdout;
  },
});

export const myStreamingScript = task({
  id: "my-streaming-python-script",
  run: async () => {
    // You can also stream the output of the script
    const result = python.stream.runScript("my_script.py", ["hello", "world"]);

    // result is an async iterable/readable stream
    for await (const chunk of streamingResult) {
      logger.debug("convert-url-to-markdown", {
        url: payload.url,
        chunk,
      });
    }
  },
});

Running Inline Python Code

import { task } from "@trigger.dev/sdk/v3";
import { python } from "@trigger.dev/python";

export const myTask = task({
  id: "to_datetime-task",
  run: async () => {
    const result = await python.runInline(`
import pandas as pd

pd.to_datetime("${+new Date() / 1000}")
`);
    return result.stdout;
  },
});

Running Lower-Level Commands

import { task } from "@trigger.dev/sdk/v3";
import { python } from "@trigger.dev/python";

export const pythonVersionTask = task({
  id: "python-version-task",
  run: async () => {
    const result = await python.run(["--version"]);
    return result.stdout; // Expected output: Python 3.12.8
  },
});

Limitations

  • This is a partial implementation and does not provide full Python support as an execution runtime for tasks.
  • Manual intervention may be required for installing and configuring binary dependencies in development environments.

Additional Information

For more detailed documentation, visit the official docs at Trigger.dev Documentation.