N
Novu6mo ago
Endy_

Cannot update variant to email step

I'm trying to add a new variant to the email step but getting this error message:
{'statusCode': 500, 'timestamp': '2025-05-08T10:54:30.175Z', 'path': '/v1/workflows/681c472468a---------', 'message': 'Internal server error, contact support and provide them with the errorId', 'errorId': 'b372269a-3893-456a-8b14-542c4ef38437'}
{'statusCode': 500, 'timestamp': '2025-05-08T10:54:30.175Z', 'path': '/v1/workflows/681c472468a---------', 'message': 'Internal server error, contact support and provide them with the errorId', 'errorId': 'b372269a-3893-456a-8b14-542c4ef38437'}
Here is the code to update:
workflow = {
"name": template_name,
"notificationGroupId": NOVU_NOTIFICATION_GROUP_ID,
"active": True,
"steps": [
{
"active": True,
"shouldStopOnFail": False,
"name": "Email",
"type": "REGULAR",
"variants": {
"active": True,
"name": language_code,
"filters": [
{
"type": "TEXT",
"value": "AND",
"children": [
{
"field": "language",
"operator": "EQUAL",
"value": language_code,
"on": "payload",
}
],
},
],
"template": {
"type": "email",
"subject": subject,
"preheader": display_header,
"content": html,
"contentType": "customHtml",
"layoutId": layout_id,
},
},
"template": {
"type": "email",
# "active": True,
# "subject": subject,
# "senderName": SENDER_NAME,
# "preheader": display_header,
# "content": html,
# "contentType": "customHtml",
# "layoutId": layout_id,
# "deleted": False,
},
}
],
}

response = requests.put(
url=f"{NOVU_WORKFLOW_URL}/{workflow_id}",
json=workflow,
headers=headers,
)
workflow = {
"name": template_name,
"notificationGroupId": NOVU_NOTIFICATION_GROUP_ID,
"active": True,
"steps": [
{
"active": True,
"shouldStopOnFail": False,
"name": "Email",
"type": "REGULAR",
"variants": {
"active": True,
"name": language_code,
"filters": [
{
"type": "TEXT",
"value": "AND",
"children": [
{
"field": "language",
"operator": "EQUAL",
"value": language_code,
"on": "payload",
}
],
},
],
"template": {
"type": "email",
"subject": subject,
"preheader": display_header,
"content": html,
"contentType": "customHtml",
"layoutId": layout_id,
},
},
"template": {
"type": "email",
# "active": True,
# "subject": subject,
# "senderName": SENDER_NAME,
# "preheader": display_header,
# "content": html,
# "contentType": "customHtml",
# "layoutId": layout_id,
# "deleted": False,
},
}
],
}

response = requests.put(
url=f"{NOVU_WORKFLOW_URL}/{workflow_id}",
json=workflow,
headers=headers,
)
5 Replies
Pawan Jain
Pawan Jain6mo ago
@Endy_ Are you self hosting novu?
Endy_
Endy_OP6mo ago
yes Is self-hosting supported for this API call?
Pawan Jain
Pawan Jain6mo ago
@Endy_ It is supported on self-hosted. It is a bit tricky to investigate the root cause as we don't have self hosted logs Could you try using "language_code" in place of language_code
Endy_
Endy_OP6mo ago
Not sure what’s causing it, but I get the steps from the workflow and append the variants, and then it works.
Novu_Bot
Novu_Bot6mo ago
@Endy_, you just advanced to level 2!

Did you find this page helpful?