flow:write.
Asset format
assets maps file paths to file descriptors:
encoding defaults to utf-8 and may be base64. Use base64 for binary files.
The entrypoint is resolved relative to the asset map. Include every local import in the request.
Create a function
POST /flow/functions
name and assets are required. entrypoint defaults to main.ts.
The response is 201 Created and includes the function record, revision_id, and revision_status. Save the revision ID for status checks and logs.
Redeploy a function
PATCH /flow/functions/:name
assets is required. entrypoint is optional. A redeploy creates a new revision while keeping the function name and invocation path stable.
List and inspect
GET /flow/functionsreturns{ "functions": [...] }.GET /flow/functions/:namereturns one function record.
flow:read.
Delete
DELETE /flow/functions/:name requires flow:delete and returns 204 No Content.
Deletion is permanent. Confirm the function name before issuing the request.
Deployment checklist
- Include the entrypoint in
assets. - Include every local import.
- Use
base64for binary files. - Save the returned
revision_id. - Poll status before sending production traffic.
- Keep a previous successful revision available for rollback.
