Can you nest steps in a function? #783
Unanswered
ShravanSunder
asked this question in
Q&A
Replies: 1 comment 4 replies
-
We currently don't support nesting steps, @ShravanSunder. You can still group sets of steps together using a regular async function: export default inngest.createFunction(
{ id: "activation-email" },
{ event: "app/user.created" },
async ({ event, step }) => {
const sendWelcomeEmail = async () => {
await step.run("do something", async () => { /* do something */ });
await step.run("do something else", async () => { /* do something else */ });
return await step.run("send-welcome-email", async () =>
sendEmail({ email: event.user.email, template: "welcome" }),
);
};
await sendWelcomeEmail();
},
); What would be your use case for nesting steps? 🙂 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is nested steps possible and are they memoized?
Would the below cause any issues or does the framework work with the below?
related to: https://github.com/orgs/inngest/discussions/586#discussioncomment-7424313
Beta Was this translation helpful? Give feedback.
All reactions