N
Novu5w ago
SHG-TV

Step has invalid result

We have the following issue, when using novu v2.0.0 self hosted and @novu/[email protected]: Workflow with id: order-recieved has an invalid state. Step with id: in-app has invalid result. Please provide the correct step result. Any ideas?
No description
4 Replies
SHG-TV
SHG-TVOP4w ago
@Support here are some additional informations:
workflow(
'order-recieved',
async ({ step, payload, subscriber }) => {
await step.inApp('in-app', async () => {
return {
subject: tolgee.t('inApp.orderRecieved.subject', {
internal_number: payload.order?.internal_number,
language: subscriber?.locale,
}),
body: tolgee.t('inApp.orderRecieved.body', {
internal_number: payload.order?.internal_number,
language: subscriber?.locale,
}),
}
});

await step.push('send-push', async () => {
return {
subject: tolgee.t('push.orderRecieved.subject', {
internal_number: payload.order?.internal_number,
language: subscriber?.locale,
}),
body: tolgee.t('push.orderRecieved.body', {
internal_number: payload.order?.internal_number,
language: subscriber?.locale,
}),
}
});

await step.email('send-email', async () => {
// TODO: support other order types
if (payload.order.type !== 'SHOP_PURCHASE_ORDER')
throw new Error(`processing of incorrect order type could not be performed. ${payload.order.type}`)

// the eshop should only support those 3 languages
const language = ['de', 'en', 'fr'].includes(subscriber?.locale || '') ? subscriber?.locale : 'en';
await ConfigUtil.init();
const subject = '...';
const body = '...';
return {
subject: subject,
body: body,
};
});
})
workflow(
'order-recieved',
async ({ step, payload, subscriber }) => {
await step.inApp('in-app', async () => {
return {
subject: tolgee.t('inApp.orderRecieved.subject', {
internal_number: payload.order?.internal_number,
language: subscriber?.locale,
}),
body: tolgee.t('inApp.orderRecieved.body', {
internal_number: payload.order?.internal_number,
language: subscriber?.locale,
}),
}
});

await step.push('send-push', async () => {
return {
subject: tolgee.t('push.orderRecieved.subject', {
internal_number: payload.order?.internal_number,
language: subscriber?.locale,
}),
body: tolgee.t('push.orderRecieved.body', {
internal_number: payload.order?.internal_number,
language: subscriber?.locale,
}),
}
});

await step.email('send-email', async () => {
// TODO: support other order types
if (payload.order.type !== 'SHOP_PURCHASE_ORDER')
throw new Error(`processing of incorrect order type could not be performed. ${payload.order.type}`)

// the eshop should only support those 3 languages
const language = ['de', 'en', 'fr'].includes(subscriber?.locale || '') ? subscriber?.locale : 'en';
await ConfigUtil.init();
const subject = '...';
const body = '...';
return {
subject: subject,
body: body,
};
});
})
No description
No description
SHG-TV
SHG-TVOP4w ago
we found, that this was likly related to the in-app step itself. as when we have removed it, it worked. was there maybe already a fix, which is not included in the docker image?
SHG-TV
SHG-TVOP4w ago
@Pawan Jain maybe this is due to: https://github.com/novuhq/novu/commit/fc5b3cb0b6a66ddd7cdf5e9933310be218d7725f and the error is not shown in the console?
SHG-TV
SHG-TVOP4w ago
we found, that this error was likly to the wrong spelling in the env-vars NOVU_API_URL and NOVU_SECRET_KEY, after fixing thos everything worked great. strange error message and hard to debug tbh. Additionaly we had to enable the feature flag: IS_WORKFLOW_PREFERENCES_ENABLED to eb able to process the events
Want results from more Discord servers?
Add your server