Skip to main content

render-lab-tasks-slack

Slack messaging for Render Workflows. Version 0.1.1 implements all ten registered tasks and the registration-free webhook adapter. Version 0.1.0 contained only slack.postMessage.

Install from PyPI with Python 3.12+:

pip install render-lab-tasks-slack==0.1.1
from render import TaskContext, Workflows
from render_lab_tasks_slack.tasks import app as slack_app, post_message

app = Workflows.from_workflows(slack_app)


@app.task(name="example.notify")
async def notify(ctx: TaskContext):
    return await ctx.run(post_message, {"text": "Hello from Python"})

Call app.start() from the workflow entry point. .tasks also exports post_message_impl(ctx, input, deps=...) for testing and re-registration under your own task name. Inject SlackDeps with fake SlackPort/SlackWebPort objects.

Contract

Input requires text and supports title, context, markdown, blocks, attachments, channel, and username. Explicit blocks (including an empty list) override generated blocks. Titles, context, and markdown generate Block Kit; double-star markdown bold becomes Slack single-star bold.

Delivery matches the TypeScript task:

  1. A channel plus SLACK_BOT_TOKEN uses chat.postMessage and returns {delivered: true, channel, ts}. This route sends text and blocks; legacy attachments and username are webhook-only, matching the TS implementation.
  2. Otherwise SLACK_WEBHOOK_URL is used. Its destination is fixed by Slack; the input channel is informational and is not sent in the webhook payload.
  3. Without a usable webhook, print the fallback text and return delivered: false. A bot token without a channel does not select the Web API route.

Absent optional result fields are omitted rather than serialized as null.

Environment

Variable Required Purpose
SLACK_WEBHOOK_URL No Incoming webhook destination
SLACK_BOT_TOKEN No Bot token for posting to an explicit channel

Credentials are read at execution time. HTTPX has a 30-second timeout and no automatic retries. Render retries failures up to four times with a 1000 ms base delay and 2x backoff. Slack Web API ok: false responses raise even with HTTP 200. Slack posts are not exactly-once: a retry after an uncertain delivery can duplicate a message. Webhook exceptions omit the credential-bearing URL.

Full Web API surface

open_thread, update_message, await_reaction, await_reply, add_reaction, schedule_message, list_channel_history, get_permalink, and upload_file are available from .tasks with raw *_impl exports. They require SLACK_BOT_TOKEN or an injected SlackDeps.web. Await operations make one read per durable attempt and throw while the requested reaction/reply is absent. The upload port preserves the pinned TS files.upload endpoint; its current vendor availability remains a live-verification backlog item in both repos.

Webhook adapter

render_lab_tasks_slack.webhooks.slack_adapter(on_event, ...) returns a registration-free adapter for render_lab_triggers. The callback receives the verified event and returns {"task": "namespace.task", "args": [event]} or None. The signing credential SLACK_SIGNING_SECRET is read inside verification unless provided explicitly. Importing this module does not register tasks. Signature checks use the raw body; live delivery remains in the testing backlog.

Metadata

Release files for render-lab-tasks-slack 0.1.2

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

Source distribution (sdist)

Source distribution for render-lab-tasks-slack 0.1.2
File Size Uploaded Provenance Actions
render_lab_tasks_slack-0.1.2.tar.gz 9.6 kB With provenance Details for render_lab_tasks_slack-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for render-lab-tasks-slack 0.1.2
File Interpreter ABI Platform Actions
render_lab_tasks_slack-0.1.2-py3-none-any.whl Python 3 none any Details for render_lab_tasks_slack-0.1.2-py3-none-any.whl

Total release size: 24.5 kB

Release files / render_lab_tasks_slack-0.1.2.tar.gz

Download URL render_lab_tasks_slack-0.1.2.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1e49b0055f2dac50a053712e8fc9da10d97d3be5309d789fdaa189d6b9829881
BLAKE2b-256 checksum
How to use checksums
6284c84c2b07ee877ffceab2425de1ee4a51fc7ef4acbd2436bd9990bd5a920c
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 Nov 27, 2026.

Transparency log

Release files / render_lab_tasks_slack-0.1.2-py3-none-any.whl

Download URL render_lab_tasks_slack-0.1.2-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23eca2ea2cbfc4cd3f37221da1d11ddbb7254ab9478890a11a143124524d8140
BLAKE2b-256 checksum
How to use checksums
7d0b67563e9a4529d47854995c6c3b48eddc8d55fc203024579528dc4415f8d0
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 Nov 27, 2026.

Transparency log

Security for render-lab-tasks-slack 0.1.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for render_lab_tasks_slack-0.1.2.tar.gz

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 Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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