1 {"slug":"/references/helper-steps/emitEventStep","title":"emitEventStep - Helper Steps API Reference","frontmatter":{"slug":"/references/helper-steps/emitEventStep","sidebar_label":"emitEventStep"},"toc":[{"title":"Example","id":"example","level":2},{"title":"Input","id":"emiteventstep-input","level":2},{"title":"Output","id":"emiteventstep-output","level":2}],"blocks":[{"kind":"markdown","html":"This documentation provides a reference to the `emitEventStep` step. It belongs to the `@medusajs/medusa/core-flows` package."},{"kind":"heading","level":2,"text":"Example","id":"example"},{"kind":"markdown","html":"To emit a single event with a data payload:\n\n```ts\nemitEventStep({\n eventName: \"custom.created\",\n data: {\n id: \"123\"\n }\n})\n```\n\nTo emit an event multiple times with different data payloads, pass an array of objects to the `data` property:\n\n```ts\nemitEventStep({\n eventName: \"custom.created\",\n data: [\n // emit will be emitted three times, once per each object in the array\n { id: \"123\" },\n { id: \"456\" },\n { id: \"789\" }\n ]\n})\n```"},{"kind":"heading","level":2,"text":"Input","id":"emiteventstep-input"},{"kind":"typeList","sectionTitle":"emitEventStep","openedLevel":1,"types":[{"name":"Input","type":"`Input`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]},{"kind":"heading","level":2,"text":"Output","id":"emiteventstep-output"},{"kind":"typeList","sectionTitle":"emitEventStep","openedLevel":1,"types":[{"name":"WorkflowDataProperties","type":"[WorkflowDataProperties](/references/workflows/types/workflows.WorkflowDataProperties)<object>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"eventGroupId","type":"`undefined` \\| `string`","description":"","optional":false,"defaultValue":"context.eventGroupId","expandable":false,"children":[]},{"name":"eventName","type":"`string`","description":"","optional":false,"defaultValue":"input.eventName","expandable":false,"children":[]}]}]}]}