Create or update a durable function
Changed onUpload a durable function source bundle. Creates the function on the first call for a name and redeploys it on every call after that, the same create-or-update contract POST /projects/{id}/functions has.
Volcano builds and deploys asynchronously. A deployment that starts immediately returns status: provisioning, then transitions to active or failed; a deployment that has to wait for a running one is exposed through pending_deployment_id. Existing executions keep running against the runtime they started on.
The durable configuration is derived from the project's plan rather than supplied here, and is fixed once the function exists. A name already held by a standard function is rejected with 409: a function cannot change kind.
Request
- Base URLhttps://api.volcano.dev
- Auth
- HTTP bearer
- or HTTP bearer
Path parameters
Project ID
Request body multipart/form-data
DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen)
ZIP or tar.gz archive containing function source code plus dependency manifests/lockfiles.
Runtime environment. Required. Durable execution needs the durable authoring API, which ships for these runtimes only; any other runtime is rejected with 400 and the response names the ones that work. Note that a durable Python function needs a newer runtime than a standard one defaults to. GET /functions/runtimes reports durable_capable per runtime.
The name of the function to invoke. Defaults to "handler" if not specified.
Who may start an execution. Redeploying is the only way to change it, since the collection has no update endpoint; omit it to keep the current visibility, and a new function starts private.
The standard collection's synchronous invocation fields — invocation_mode, http_auth_mode, openapi_spec — configure a request path no durable route serves, and are rejected with 400 rather than ignored.
Deprecated alias for visibility: true means public and false means authenticated. Sending both with different meanings returns 400.
Which project variables this function receives. all (the default) gives it every project variable; scoped gives it only the variables it selects. Omitting this leaves an existing function's scope unchanged.
JSON-encoded array of project variable names this function requires, on top of the ones detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when variable_scope is scoped. Omitting this leaves an existing function's declared names unchanged.
JSON-encoded commit the uploaded source came from: {"repository": "acme/app", "sha": "<40-character commit ID>", "dirty": false}. repository is owner/name or a github.com remote URL (https://github.com/acme/app.git, git@github.com:acme/app.git, or ssh://git@github.com/acme/app.git); Volcano drops any credentials in the URL and records owner/name. dirty is true when the uploaded files differ from the commit. All three fields are required, and fields Volcano does not know are ignored. An empty value, null, or "" reports no commit. A malformed commit, or a repository not on GitHub, returns 400 before anything is deployed. Volcano records a function's commit with commit.verified: false.
Example request
{
"name": "order-pipeline",
"runtime": "nodejs24.x",
"handler": "handler"
}Response
Existing durable function updated; its deployment was started or queued
A durable function. Separate from Function because a durable function is invoked only through its own execution endpoints, so it has no invocation mode, HTTP auth mode, OpenAPI document or invoke URL, and it carries a durable configuration that a standard function has no field for.
Timestamp when the current provisioning phase started
Who may start executions of this function through POST /durable-functions/{functionId}/executions, and read and stop them through GET /durable-functions/{functionId}/executions/{executionId} and its /stop: service keys at every level (a scoped key needs functions.invoke), signed-in users of the project from authenticated, and anon keys holding functions.invoke only at public. On the read and stop routes a service key holding *, the default, reaches every execution. A service key scoped to a list without * and an anon key reach the ones whose client token they send, which the start returns, and a signed-in user also the ones they started. The project-scoped routes under /projects/{id}/durable-functions take the project owner's token or a project access token, whatever this is set to.
Set it when the function is deployed. Durable functions have no update endpoint, so changing visibility later means redeploying.
A durable function is startable, never invocable: it is not reachable through POST /functions/{functionId}/invoke or a function URL, which answer 404 at every level.
Deprecated. true exactly when visibility is public.
Execution limits the function was created with, derived from the project's plan. Fixed for the life of the function: changing them means creating a new one.
The memory the function runs at, and the timeout on one attempt within an execution, also come from the plan but are not reported here: they are applied to the deployed function rather than recorded on it. Both are published per plan in the plans and limits guide.
Regions where this function is currently deployed
Identifier of the latest deployment operation
Newest queued deployment that will run after the current operation
Most recent successful invocation timestamp
Changes
- info
added the new optional request property
commit
- info
- info
the endpoint scheme security
ProjectAccessTokenwas added to the API
- info