Files
motia-iii/steps/list_tickets_step.py
bsiggel b3bdb56753 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
2026-03-01 21:38:07 +00:00

25 lines
657 B
Python

"""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)})