Initial commit: Motia III Backend Setup
- iii-config.yaml mit Production-Settings (CORS, all interfaces) - Ticketing-System Steps (create, triage, escalate, notify, SLA monitoring) - Python dependencies via uv - Systemd services für Motia Engine und iii Console - README mit Deployment-Info
This commit is contained in:
24
steps/list_tickets_step.py
Normal file
24
steps/list_tickets_step.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""List Tickets Step - returns all tickets from state."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
from motia import ApiRequest, ApiResponse, FlowContext, http
|
||||
|
||||
config = {
|
||||
"name": "ListTickets",
|
||||
"description": "Returns all tickets from state",
|
||||
"flows": ["support-ticket-flow"],
|
||||
"triggers": [
|
||||
http("GET", "/tickets"),
|
||||
],
|
||||
"enqueues": [],
|
||||
}
|
||||
|
||||
|
||||
async def handler(request: ApiRequest[Any], ctx: FlowContext[Any]) -> ApiResponse[Any]:
|
||||
_ = request
|
||||
tickets = await ctx.state.list("tickets")
|
||||
|
||||
ctx.logger.info("Listing tickets", {"count": len(tickets)})
|
||||
|
||||
return ApiResponse(status=200, body={"tickets": tickets, "count": len(tickets)})
|
||||
Reference in New Issue
Block a user