A Cloudflare Zero-Scale Slack Worker for Zeebe on Camunda Cloud
APACHE-2.0 License
This is a Cloudflare worker that provides a zero-scale Slack messaging task for Camunda Cloud, using the Camunda Cloud HTTP Worker.
On the free tier of Cloudflare Workers, you can send 100,000 messages a day.
npm i
.wrangler
, the Cloudflare Worker CLI:npm i -g wrangler
wrangler.toml
in the account_id
field.wrangler config
.wrangler publish
slackWorkerUrl
and paste in your Cloudflare Worker url.slackWebhook
and paste in your Slack webhook url.Check the bpmn/test-message.bpmn
file for an example.
To send a message to Slack in a business process, add a task with the Type "CAMUNDA-HTTP".
Set these Headers on the task:
url : ${slackWorkerUrl} slackWebhook : ${slackWebhook} method : post
You have two options for setting the message.
message
variable in the workflow.Either way, any field that you want replaced by a variable from the workflow should be escaped like this: {{ variable }}
.
The templating is performed using micromustache.
In the example, the message is set in the headers: Hello {{ name }}
. When the worker receives a job, it substitutes the value of the variable name
. If you examine the file bpmn/test.js
, you'll see that it kicks off a workflow setting the variable name
to "World!", leading to the Slack message "Hello World!".
bpmn
directory.npm i
.ZEEBE_ADDRESS=${YOUR CLUSTER CONTACT POINT} ZEEBE_CLIENT_ID=${CLIENT ID} ZEEBE_CLIENT_SECRET=${CLIENT SECRET} node index.js