render-lab-triggers
Registration-free HTTP, webhook, and cron dispatch to a separate Render Workflow.
from render_lab_triggers import create_dispatch_server
app = create_dispatch_server()
# uvicorn main:app --host 0.0.0.0 --port 3000
GET /healthz returns ok. POST /tasks/{namespace.task} requires
Authorization: Bearer <DISPATCH_TOKEN> and accepts JSON positional arguments
(an array), a single JSON value, or an empty body ([{}]). It returns HTTP 202
with runId. Add ?wait=1 for a bounded wait: HTTP 200 with status/results on
completion or HTTP 202 when the wait expires. The default wait is 25 seconds.
create_dispatch_server accepts workflow_slug, token, dispatcher,
webhooks, wait_timeout_ms, and max_body_bytes. Bodies are capped at 1 MiB
by counting streamed bytes, regardless of Content-Length. Oversized bodies
return 413 before signature verification. The ASGI server owns connection cleanup.
Vendor adapters live in render_lab_tasks_<vendor>.webhooks; mount them in the
webhooks mapping at /webhooks/{name}. Their verify function sees the exact
raw UTF-8 body and lowercase headers before JSON parsing. map returns a
{"task": ..., "args": [...]} dispatch or None to acknowledge and ignore.
As in the pinned TS server, webhook bodies must be JSON. Twilio form-encoded
signatures can be verified with its standalone adapter, but form dispatch needs
a custom endpoint that decodes the form after verification.
from render_lab_triggers import run_cron
# In an async cron entry point:
# result = await run_cron(task="report.daily", args=[{}])
run_cron defaults to asynchronous dispatch. wait=True waits at most five
minutes; wait_timeout_ms overrides it. render_dispatcher(slug=...) starts via
the pinned Render SDK and consumes its public SSE event iterator. It closes
streams on completion, timeout, and cancellation, without adding retries.
client= injects a RenderAsync-compatible client; the caller owns that client.
serve_dispatch_server(port=..., **options) runs Uvicorn until shutdown.
Environment
WORKFLOW_SLUG: target Workflow slug, unless provided explicitly.DISPATCH_TOKEN: bearer token for/tasks/*; unset rejects all such requests.RENDER_API_KEY: Render SDK credential, read when dispatching.CRON_TASK: default cron task name.CRON_INPUT: JSON cron input; an array is positional arguments.PORT: serving port, default 3000.
Imports never read credentials or register tasks. Tests inject dispatchers and SDK event streams; live cross-service dispatch remains in the testing backlog.
Installation
pip install render-lab-triggers==0.1.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file render_lab_triggers-0.1.0.tar.gz.
File metadata
- Download URL: render_lab_triggers-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31a1c5c5f7da7d4f0dbd655648ccfb8d895b63a1aa0c4107016d42420e121ae5
|
|
| MD5 |
d4d51f8a8da2ac9c6f242abde9fcc690
|
|
| BLAKE2b-256 |
31fc70212af3e99b9f2653170afc5a956846169be93e2fdf79e0184bf9857807
|
Provenance
The following attestation bundles were made for render_lab_triggers-0.1.0.tar.gz:
Publisher:
publish.yml on render-lab/render-tasks-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
render_lab_triggers-0.1.0.tar.gz -
Subject digest:
31a1c5c5f7da7d4f0dbd655648ccfb8d895b63a1aa0c4107016d42420e121ae5 - Sigstore transparency entry: 2767850041
- Sigstore integration time:
-
Permalink:
render-lab/render-tasks-python@b601664587ba5882dd7c8efabfc8908151008df6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/render-lab
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b601664587ba5882dd7c8efabfc8908151008df6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file render_lab_triggers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: render_lab_triggers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8647d6a5386d2c637456738142ddada6a3e08f05e98aa4f5462402c08b30d1d
|
|
| MD5 |
a262cd69964753ccdf36ff73f5c84d7b
|
|
| BLAKE2b-256 |
1d86edc112b02324ecea5f8cb997d73286dd2ef404f3e5db94a285286a28ca10
|
Provenance
The following attestation bundles were made for render_lab_triggers-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on render-lab/render-tasks-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
render_lab_triggers-0.1.0-py3-none-any.whl -
Subject digest:
e8647d6a5386d2c637456738142ddada6a3e08f05e98aa4f5462402c08b30d1d - Sigstore transparency entry: 2767850069
- Sigstore integration time:
-
Permalink:
render-lab/render-tasks-python@b601664587ba5882dd7c8efabfc8908151008df6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/render-lab
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b601664587ba5882dd7c8efabfc8908151008df6 -
Trigger Event:
workflow_dispatch
-
Statement type: