Skip to main content

render-lab-tasks-slack

Slack messaging for Render Workflows. Initial subset: slack.postMessage. The other TypeScript Slack tasks and inbound webhook adapter are not yet ported.

This distribution is not yet on PyPI. From this repository:

uv pip install ./packages/tasks-slack
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.

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_tasks_slack-0.1.0.tar.gz (6.2 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_tasks_slack-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file render_lab_tasks_slack-0.1.0.tar.gz.

File metadata

  • Download URL: render_lab_tasks_slack-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for render_lab_tasks_slack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 252ffc13bb9d92504f621ab3acf92805980eb812b574cb5056ca7dcf7c0fd5e4
MD5 aea7532dd05784803b417a5b1303709c
BLAKE2b-256 5a317d74a7a8b6f71aee4e3c14e7c8d0011aaa8d37174ef515d45a0b9604f98d

See more details on using hashes here.

Provenance

The following attestation bundles were made for render_lab_tasks_slack-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_tasks_slack-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for render_lab_tasks_slack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45a373bb07711af37815e4551071b38416077c3c3435d4595e44566e0caf5760
MD5 fb6f31679d5b0fdc1763362c92d6da63
BLAKE2b-256 6bd239cc9b0a1543a31f751feabf46aca3b66f61337d71778cc8c720c40c910c

See more details on using hashes here.

Provenance

The following attestation bundles were made for render_lab_tasks_slack-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

0.1.1

2 files

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