68 lines
1.9 KiB
JSON
68 lines
1.9 KiB
JSON
[
|
|
{
|
|
"id": "step-configuration",
|
|
"title": "Step Configuration",
|
|
"description": "All steps should have a defined configuration, this is how you define the step's behavior and how it will be triggered.",
|
|
"lines": [
|
|
"5-19"
|
|
]
|
|
},
|
|
{
|
|
"id": "event-configuration",
|
|
"title": "Event Step",
|
|
"description": "Definition of an event step that subscribes to specific topics",
|
|
"lines": [
|
|
"12",
|
|
"15-16"
|
|
]
|
|
},
|
|
{
|
|
"id": "input-schema",
|
|
"title": "Input Schema",
|
|
"description": "Definition of the expected input data structure from the subscribed topic. Motia will automatically generate types based on this schema.",
|
|
"lines": [
|
|
"5-9",
|
|
"17"
|
|
]
|
|
},
|
|
{
|
|
"id": "event-emits",
|
|
"title": "Emits",
|
|
"description": "We can define the events that this step will emit, triggering other Motia Steps.",
|
|
"lines": [
|
|
"17"
|
|
]
|
|
},
|
|
{
|
|
"id": "handler",
|
|
"title": "Handler",
|
|
"description": "The handler is the function that will be executed when the step receives an event from its subscribed topic. It processes the input data and can emit new events.",
|
|
"lines": [
|
|
"21-50"
|
|
]
|
|
},
|
|
{
|
|
"id": "state",
|
|
"title": "State Management",
|
|
"description": "The handler demonstrates state management by storing order data that can be accessed by other steps.",
|
|
"lines": [
|
|
"35"
|
|
]
|
|
},
|
|
{
|
|
"id": "event-emission",
|
|
"title": "Event Emission",
|
|
"description": "After processing the order, the handler emits a new event to notify other steps about the new order.",
|
|
"lines": [
|
|
"37-50"
|
|
]
|
|
},
|
|
{
|
|
"id": "logger",
|
|
"title": "Logger",
|
|
"description": "The logger is a utility that allows you to log messages to the console. It is available in the handler function and automatically ties to the trace id of the request.",
|
|
"lines": [
|
|
"22"
|
|
]
|
|
}
|
|
] |