Skip to main content

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

render_lab_triggers-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

render_lab_triggers-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

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

Hashes for render_lab_triggers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 31a1c5c5f7da7d4f0dbd655648ccfb8d895b63a1aa0c4107016d42420e121ae5
MD5 d4d51f8a8da2ac9c6f242abde9fcc690
BLAKE2b-256 31fc70212af3e99b9f2653170afc5a956846169be93e2fdf79e0184bf9857807

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file render_lab_triggers-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for render_lab_triggers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8647d6a5386d2c637456738142ddada6a3e08f05e98aa4f5462402c08b30d1d
MD5 a262cd69964753ccdf36ff73f5c84d7b
BLAKE2b-256 1d86edc112b02324ecea5f8cb997d73286dd2ef404f3e5db94a285286a28ca10

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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