-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Bug Report: Skipped inapp step will cause fail #7375
Comments
Also happens when previews step is a custom step with required output schema const testWorkflow = workflow('test-workflow', async ({ step, payload }) => {
const resp = await step.custom('custom', async () => {
return {
body: 'This is a log message',
subject: "dsad"
}
}, {
skip: () => payload.userName === 'John Doe',
outputSchema: z.object({
body: z.string(),
subject: z.string(),
}),
});
await step.email('send-email', async (controls) => {
return {
subject: controls.subject,
body: 'This is your first Novu Email ' + payload.userName,
};
},
{
controlSchema: z.object({
subject: z.string().default('A Successful Test on Novu from {{userName}}'),
}),
});
}, {
payloadSchema: z.object({
userName: z.string().default('John Doe'),
}),
}); Error {
"message": "Workflow with id: `test-workflow` has an invalid state. Step with id: `custom` has invalid result. Please provide the correct step result.",
"code": "ExecutionStateResultInvalidError",
"data": [
{
"path": "/body",
"message": "Required"
},
{
"path": "/subject",
"message": "Required"
}
} Root reason seems to be in https://github.com/m1heng/novu/blob/fix/api-property/packages/framework/src/client.ts#L314-L333 |
A simple way to deal with it is add skip check for non current step, but this would leads to a problem that whether should the framework ask developer to make their |
📜 Description
When previous inapp step is skipped, next step will show error.
👟 Reproduction steps
👍 Expected behavior
next step should run without error
👎 Actual Behavior with Screenshots
Novu version
Novu SaaS
npm version
No response
node version
No response
📃 Provide any additional context for the Bug.
No response
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Contributing Guidelines?
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered: