would this be valid workflows code? everything is deterministic as all results are computed from ste

would this be valid workflows code? everything is deterministic as all results are computed from steps, and i just await them all at the end
const generateTitleStep = step.do(
  "Generate the project title",
  async () => {
    console.log("Generate the project title");
    const anthropic = createAnthropic({
      apiKey: this.env.ANTHROPIC_API_KEY,
    });

    return {};
  },
);
const generateNotesStep = step.do(
  "Generate the project notes",
  async () => {
    console.log("Generate the project notes");
    return {};
  },
);
// option A
await step.do("Await all project generation steps", async () => {
  await generateTitleStep;
  await generateNotesStep;
});
// option B
await Promise.all([generateTitleStep, generateNotesStep]);
Was this page helpful?