Functions¶
Poly has three callable function kinds. After you generate an SDK they all show up as poly.<context>.<name>. They run in different places.
Need an endpoint, job, trigger, snippet, or AI Function as well? Start at Choosing a Poly resource.
Kind |
Runs |
Use when |
|---|---|---|
Poly gateway, as a trained HTTP call to a third-party API |
You already have an HTTP API and want auth, URL, and body templating in the catalog |
|
Poly’s Knative FaaS |
You need hosted logic, a webhook/job/GraphQL target, logs, or a callable from any SDK language |
|
The caller’s process (your laptop, or inside a server function) |
You want a same-language helper that is fast and is not billed as a server execution |
Older training copy called these custom functions. The name to use is server function.
How names work¶
Each function has a context (namespace, may contain periods) and a name.
The SDK path is poly.<context>.<name>. Nested context becomes nested objects: context some.custom.context plus name fn is poly.some.custom.context.fn.
The fully-qualified token is context.name, or just context if there is no name, or just name if there is no context. Context is case-sensitive.
Within one environment, context + name is unique. If a tenant-level or public function uses the same pair, the environment-level function wins at generate and execute.
Create vs execute¶
Train creates API functions (Postman or OpenAPI).
Deploy (
function add --server/--client, or Project Glide) creates server and client functions.Execute applies to API and server functions (
POST /functions/api/:id/executeandPOST /functions/server/:id/execute). Client functions have no execute route; their code runs in-process.
Permissions (v1 API key flags):
Create/update/delete API functions: Manage API Functions
Create/update/delete server or client functions: CustomDev
Execute API or server functions: Execute
See API Key Permissions.
Onward¶
Choose a resource type: Choosing a Poly resource
Train an API: API Function Training
Deploy a server function: Server Functions
Language SDKs: Generated SDKs
Client caveats: Client Functions
Runtime shape: Platform architecture