Run the function once in a separate, time-boxed process and relay its answer.
const url = 'https://infra-hyphae.run/v0/projects/example/functions/example/invoke';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '"example"'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://infra-hyphae.run/v0/projects/example/functions/example/invoke \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '"example"'Body: JSON ≤ 32 KiB (or empty). The worker receives on stdin
{ body, headers_subset, project_id, function } and must write one
JSON object { status, headers?, body } ≤ 1 MiB to stdout. The
response is the function’s own status, allowed headers, and body
(string → text, anything else → JSON), marked with
X-Hyphae-Function and X-Hyphae-Function-Version. Cloud-side
outcomes: 501 function_runtime_missing (no deno/node),
504 function_timeout (process group killed after
CLOUDD_FN_TIMEOUT_MS, default 5000), 502 function_bad_output
(crash, non-JSON, oversize), 429 function_busy (two invocations of
this project already running). Environment given to the worker:
CLOUD_ORIGIN, PROJECT_ID, FUNCTION_NAME, plus the project’s
function secrets as NAME=value; never a hyp1_ key. The function
is trusted project code, not sandboxed — see claims.md.
Session owner only. The invocation is receipted; the body is not
stored.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”Examplegenerated
exampleResponses
Section titled “ Responses ”The function’s answer.
The function’s own 4xx (with X-Hyphae-Function), or a Cloud error (400, 401, 404, 413, 429).
The function’s own 5xx (with X-Hyphae-Function), or a Cloud error (501, 502, 504).