Can anyone share how to create a back off digest workflow?
The API is super unclear, and the AI assistant also doesn't give good results,
i've tried to create a backoff digest, but when triggering it - the body/subject is not passed on.
i can't debug it as workflow editor crashes (the editor doesn't support backoff configuration)
I've tried this curl but subject and body are not sent
curl --request PUT \
--url https://api.novu.co/v1/workflows/677bedfba349a0b72e9d30d7 \
--header 'Authorization: ApiKey zz' \
--header 'Content-Type: application/json' \
--data '{
"name": "Digest Workflow",
"description": "Workflow with digest and in-app notification",
"notificationGroupId": "677bc6ac7e6bad582ab0db47",
"active": true,
"steps": [
{
"name": "Digest Step",
"template": {
"type": "digest",
"content": ""
},
"metadata": {
"amount": 20,
"unit": "seconds",
"type": "backoff",
"backoffAmount": 20,
"backoffUnit": "seconds",
"digestKey": "{{subscriber.subscriberId}}-{{payload.id}}"
}
},
{
"name": "In-App Notification",
"template": {
"type": "in_app",
"content": "{{payload.body}}",
"title": "{{payload.subject}}"
}
}
],
"triggers": [
{
"type": "event",
"identifier": "digest-workflow-trigger",
"variables": [
{
"name": "id"
},
{
"name": "subject"
},
{
"name": "body"
}
]
}
]
}'
2 Replies
@Arielb135
Is there any particular reason of using API to create workflow?
I would recommend using
@novu/framework
or UI to create workflow with digest step
@Arielb135
Are you creating above workflow for this usecase?
https://discord.com/channels/895029566685462578/1325856802533019771UI doesn't support back off digest feature, and I haven't managed yet to do it through the framework, I'll retry today but the docs are really not clear of how to do it