Type cannot be null or undefined
headers = {
'Authorization': f'ApiKey {api_key}',
'Content-Type': 'application/json'
}
payload = {
"notificationGroupId": "507f1f77bcf86cd799439014",
"name":"email-workflow",
"steps": [
{
"type": "custom",
"template": {
"subject": "Welcome!",
"body": "Thank you for signing up."
},
"recipient": "[email protected]",
"filters": [
{
"property": "user.role",
"operator": "equals",
"value": "new_user"
}
],
"variant": {
"variantName": "New User Welcome Email",
"variantId": "507f1f77bcf86cd799439011"
}
},
],
} response = requests.post('https://api.novu.co/v1/workflows', headers=headers, json=payload) Im new to novu workflows, i'm trying to create a workflow using the above code,and im getting this error when i run this code Error: Failed to create workflow: 400 {'message': ['type should not be null or undefined', 'type must be one of the following values: in_app, email, sms, chat, push, digest, trigger, delay, custom'], 'error': 'Bad Request', 'statusCode': 400}
],
} response = requests.post('https://api.novu.co/v1/workflows', headers=headers, json=payload) Im new to novu workflows, i'm trying to create a workflow using the above code,and im getting this error when i run this code Error: Failed to create workflow: 400 {'message': ['type should not be null or undefined', 'type must be one of the following values: in_app, email, sms, chat, push, digest, trigger, delay, custom'], 'error': 'Bad Request', 'statusCode': 400}
19 Replies
@Guna Vardhan
I see you are trying to create a new workflow using code
Did you get a change to try novu v2 (code based workflow approach)?
from the api reference of the novu documentation?
tried it the next js application is not getting connected to the bridge endpoint
please share the error screenshot
okay
But can you tell me what's going wrong with the code above?
steps": [
{
"type": "custom",
here
custom
is not supported with novu v1even if i use email or sms im getting same error
i have set up the next js application
@Guna Vardhan, you just advanced to level 1!
can you help me what to do next?
@Guna Vardhan is your application running on port 4000 ?
also, do you have your second terminal still running? (npx novu dev)
yes
Could you share a photo of the
npx novu@latest dev
command in your terminal?okay
Tahnk you!
I was able to replicate this with brave browser
do you by chance can try this on chrome?
meanwhile we check the issue with Brabe
sure
thanks
when i tried to test workflow i'm getting status 500
in chrome
can you try copying your "Tunnel" url from the cli and making a request to: https://YOUR_TUNNEL.novu.sh/api/novu?action=health-check
its working thanks!