Request Lifecycle
Understanding how a request flows through Apify.
Flow
- Ingress: Request arrives at a configured Listener (e.g., port 8080).
- Routing: The router matches the URL path and HTTP method to an Operation defined in an OpenAPI spec.
- Authentication:
- Global auth providers check for credentials (e.g., API Key).
- If valid, the request proceeds.
- Validation:
- Path parameters, query parameters, and request body are validated against the OpenAPI schema.
- Invalid requests are rejected with 400 Bad Request.
- Processing:
- The
x-apify-actiondetermines the logic (e.g.,list,create). - SQL is generated based on the action and parameters.
- The
- Data Access:
- The query is executed against the mapped Datasource.
- Response:
- Results are serialized to JSON.
- Response headers are set.
- Response is sent to the client.