Skip to main content

convalesce-emit-prefect

Forward Prefect flow and task run state to Convalesce, unchanged.

Install

pip install convalesce-emit-prefect

Wire it up

The package exports plain hook functions. Attach them to a flow or task and Prefect calls them, by keyword on 2.x and positionally on 3.x:

from prefect import flow, task
from convalesce_emit_prefect import emit_flow_run, emit_task_run


@task(on_completion=[emit_task_run], on_failure=[emit_task_run])
def extract():
    ...


@flow(on_completion=[emit_flow_run], on_failure=[emit_flow_run])
def nightly():
    extract()

Set CONVALESCE_INGEST_KEY where the flow runs.

Both functions also serve on_running, and emit_flow_run serves on_crashed and on_cancellation. Wire those too: a flow that crashes or is cancelled never fires on_failure, so without them its run never ends.

Declare lineage

Prefect knows which task fed which, not which tables a task read or wrote. Say so inside the task, and its task-run hook sends it:

from convalesce_emit_prefect import lineage


@task(on_completion=[emit_task_run], on_failure=[emit_task_run])
def load():
    lineage(
        inputs=[{"platform": "postgres", "name": "shop.public.orders"}],
        outputs=["urn:li:dataset:(urn:li:dataPlatform:snowflake,db.s.t,PROD)"],
    )

Each dataset is a urn, or a platform and name with an optional env (PROD by default).

On Prefect 3, a task's own assets need none of this: the task-run hook of an @materialize task sends the assets it writes and the asset_deps it reads, and the receiver follows assets handed on by upstream task runs the way Prefect does.

A failed task's hook also sends the exception and its traceback, when Prefect holds it in memory; a result persisted to storage is not read back.

Supported

Prefect 2.20 and 3.x, on Python 3.9 and later. Verified on real installs: see version-support.md.

Configure

Read from the environment: see convalesce-emit.

Each event also reads the Prefect API directly for the flow record, the run graph, the full task-run list and, on Prefect Cloud, the workspace -- state a hook's own arguments never carry. This is on by default and needs no configuration beyond CONVALESCE_INGEST_KEY; set CONVALESCE_PREFECT_API_READS=false to turn it off if this process's Prefect API is locked down, and still get everything the hook's own arguments already carry.

A flow's parameters are what launched the run typed, and can be customer data. Only their names and types are sent ({"since": "<str>"}), for the run and for the flow's defaults, and the payload says so in excluded. Set CONVALESCE_PREFECT_SEND_PARAMETERS=true to send the values; anything named like a credential is still redacted.

Release files for convalesce-emit-prefect 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for convalesce-emit-prefect 0.1.5
File Size Uploaded
convalesce_emit_prefect-0.1.5.tar.gz 36.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for convalesce-emit-prefect 0.1.5
File Interpreter ABI Platform
convalesce_emit_prefect-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 60.9 kB

Release files / convalesce_emit_prefect-0.1.5.tar.gz

Download URL convalesce_emit_prefect-0.1.5.tar.gz
Size 36.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2b188c6e64c841c53c7f21a18b0733b751784739774aeef3315ef2e575fb34b8
BLAKE2b-256 checksum
How to use checksums
6df1c57eba57391db31322e6f7cc3487543d78423865475c9d31c41367fd8312
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / convalesce_emit_prefect-0.1.5-py3-none-any.whl

Download URL convalesce_emit_prefect-0.1.5-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b5a9228dc6eba637b6bd16192f3e74aa6780a5c8675b7470c7e096e4d2459a0
BLAKE2b-256 checksum
How to use checksums
3672f8ef0a1e66ae43b0de6123d0f46d27ecf3d0c9eb45d595434177f72e0f77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page