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:
- A channel plus
SLACK_BOT_TOKENuseschat.postMessageand returns{delivered: true, channel, ts}. This route sends text and blocks; legacy attachments and username are webhook-only, matching the TS implementation. - Otherwise
SLACK_WEBHOOK_URLis used. Its destination is fixed by Slack; the input channel is informational and is not sent in the webhook payload. - 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.
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_tasks_slack-0.1.1.tar.gz.
File metadata
- Download URL: render_lab_tasks_slack-0.1.1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58a9151ebf57e7196ea655cde3df885208d756ba07ebff12f77189c56585efcf
|
|
| MD5 |
06fe839a71db9dd1f51e9cceaf8749d1
|
|
| BLAKE2b-256 |
a33e3d501e842766bba0c3fa7fbd3d6d7fc1cc5dedab5218cfccb463ffb1ad23
|
Provenance
The following attestation bundles were made for render_lab_tasks_slack-0.1.1.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_tasks_slack-0.1.1.tar.gz -
Subject digest:
58a9151ebf57e7196ea655cde3df885208d756ba07ebff12f77189c56585efcf - Sigstore transparency entry: 2768028078
- 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_tasks_slack-0.1.1-py3-none-any.whl.
File metadata
- Download URL: render_lab_tasks_slack-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.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 |
7648c4522702c1491182c5ec38087404724f5b02147626ac15760c5ea1cb2154
|
|
| MD5 |
bccd5bcea875a11c80de4c54b0751f08
|
|
| BLAKE2b-256 |
d844a137bed893af437d4055ad0e4446325d4aeb5a7376cd4a5520b957db695b
|
Provenance
The following attestation bundles were made for render_lab_tasks_slack-0.1.1-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_tasks_slack-0.1.1-py3-none-any.whl -
Subject digest:
7648c4522702c1491182c5ec38087404724f5b02147626ac15760c5ea1cb2154 - Sigstore transparency entry: 2768028126
- 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: