Skip to Content
Workloads

Job

Run code once with an input, read the run's result and logs, cancel a run, and give a Job the stores and network access that its code uses.

This page lists the spec and status fields of Job and JobRun, each with its type, its limits and its description. The Platform page explains the concept, and the metadata of every kind is the same.

Job

apiVersion: funcd.io/v1alpha1
kind: Job
metadata:
  name: report
  namespace: default
  resourceGroup: rg1
spec:
  runtime: nodejs22
  handler: handle
  image: registry.example.com/report:1.0.0
  timeout: 10m
  concurrency: 2
  approval:
    bypass: true
apiVersionkind
funcd.io/v1alpha1Job

Job.spec

FieldType and limitsDescription
approvalobject, Job.spec.approvalWhether a run waits for a person's approval of its preview before it runs. Unset, every run previews and waits.
bindingsobject, Job.spec.bindingsWhat the code may use: KV tables, Bucket prefixes, SQL databases, Lakes and Functions, each under an alias, and ConfigMaps and Secrets. A binding is the grant: a call on an alias with no binding is refused with 403. Each store, Lake, ConfigMap and Secret it names must be declared at the root, in this spec's kv, buckets, sql, lakes, configMaps or secrets.
bucketsarray of Job.spec.buckets[]The Buckets the Job declares: by name it creates and owns one, and a Bucket of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.blob binds only a declared Bucket.
concurrencyinteger, 1 to 15How many of the Job's runs may hold a worker at once, those Previewing included: 1 to 15; unset means 1, and a local volume allows only 1. A run past it waits in Pending with Queued.
configMapsarray of Job.spec.configMaps[]The ConfigMaps the Job declares: by name it defines one from its data, which goes with the Job, by ref it uses an existing one. spec.bindings.config binds only a declared ConfigMap.
handlerstring, matching ^[A-Za-z_][A-Za-z0-9_.]*$The name of the export that the shim calls once for each run, such as handle. A Job without one, or whose code has no such export, is not Ready, with ShapeInvalid.
imagestringThe OCI reference of the code's artifact: a registry reference with a tag or a digest, or an oci-layout:// reference to a layout on the server's disk. A Job whose image is missing, or cannot be resolved or pulled, starts no run.
imageDigeststring, a sha256 digestThe sha256 digest that funcd pulls the image by and checks it against. Unset, funcd resolves the image to its digest when it creates the Revision of a new spec and keeps that digest, so a tag that moves later changes nothing.
kvarray of Job.spec.kv[]The KVStores the Job declares: by name it creates and owns one, and a store of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.kv binds only a declared store.
lakesarray of Job.spec.lakes[]The Lakes the Job declares: by name it creates one that goes with the Job, by ref it uses an existing one. spec.bindings.lake binds only a declared Lake, and a Lake declared by name declares nothing at its own root: it binds the Job's buckets, configMaps and secrets.
resourcesobject, Job.spec.resourcesThe CPU and memory caps of each run's worker; a field left empty takes functions.defaultResources. Only the containerd runtime enforces them.
runtimestring, a DNS-1123 labelThe runtime that runs the code, such as nodejs22 or python314, or one that an Addon ships for Jobs. A Job without one is not Ready, with ShapeInvalid, and one whose runtime this node cannot run is not Ready, with RuntimeUnavailable.
secretsarray of Job.spec.secrets[]The Secrets of the namespace that the bindings may name, each with the keys the code reads; spec.bindings.secret names only a declared Secret. The Job waits in Pending, with SecretNotFound or SecretKeyMissing, until each one exists with every declared key.
sqlarray of Job.spec.sql[]The SQLDatabases the Job declares: by name it creates and owns one, and a database of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.sql binds only a declared database.
timeoutstring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)The bound on each call of a run's handler, its preview's and its apply's, from its worker's start: 0s to 168h; 0s or unset means none. A run past it ends Failed with RunTimedOut, and its worker stops.
volumesarray of Job.spec.volumes[]The directories each run's worker mounts. Apply refuses a Job with one unless runtime.mode is containerd and volumes.capacity or volumes.capacityBytes is set. A local volume is the Job's own, never a same-named Function's, and allows a concurrency of at most 1.

Job.spec.approval

FieldType and limitsDescription
bypassbooleanWhen true, a run runs at once, with no preview and no approval. Unset or false, a run first calls the code's preview, then waits in AwaitingApproval until a person approves or rejects it. A Job for unattended work sets it.
expirystring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)How long a preview stays valid for its approval: 1m to 168h; unset means 24h. A preview older than this when it is approved, or when its run's slot frees after the approval, is previewed again: the run runs when the new preview is the same document, and waits for a new approval when it differs.

Job.spec.bindings

FieldType and limitsDescription
addonarray of Job.spec.bindings.addon[]The add-on objects whose engines the code calls, each under its alias: through ctx.addon.fetch, or with any HTTP client at FUNCD_ADDON_<ALIAS>_URL with the header X-Funcd-Addon-Token set to FUNCD_ADDON_<ALIAS>_TOKEN. Each call goes through funcd, which asks Cedar for addon::call and serves only the paths that the object's edge entry serves.
blobarray of Job.spec.bindings.blob[]The Bucket prefixes the code reaches through ctx.blob, and over S3 while the S3 gateway is on, each under its alias. The binding grants reads; only the prefix's owner and the writers that a RolesAssignment names may write. A Bucket or prefix that does not exist yet holds the Function in Pending with BucketNotFound.
configarray of string values, each a DNS-1123 labelConfigMaps whose keys each worker gets as environment variables when it starts, a later ConfigMap's value winning for a key that both hold. A key that starts with FUNCD_, or that a bound Secret holds, is left out; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of a ConfigMap's. A missing ConfigMap holds the Function Failed with ConfigResolveFailed.
jobarray of Job.spec.bindings.job[]The Jobs whose runs the code starts with ctx.job.start and reads with ctx.job.get, each under its alias. The binding grants both, and a namespace Policy that forbids job::start or job::read to the Function revokes one. A run that the code starts passes the checks of a run that a person starts, and a Job's own spec refuses this list.
kvarray of Job.spec.bindings.kv[]The KV tables the code reaches through ctx.kv, each under its alias. The binding grants reads; only the table's owner and the writers that a RolesAssignment names may write. A store or table that does not exist yet holds the Function in Pending with KVStoreNotFound.
lakearray of Job.spec.bindings.lake[]The Lakes the code queries, each under its alias. The Function waits in Pending with LakeNotReady until every bound Lake is Ready.
linksarray of Job.spec.bindings.links[]The Functions the code calls, each under its alias: through ctx.invoke one whose protocol is cloudevent, through ctx.fetch one whose protocol is http. Each target must exist in the namespace when this Function is applied, the namespace's links form no cycle, and a Function that a link targets cannot be deleted until the link goes.
secretarray of string values, each a DNS-1123 labelSecrets whose keys the code reads through ctx.secret, on each read and with no cache, a later Secret's value winning for a key that both hold. No value reaches the worker's environment. No worker starts while a bound Secret is missing, and a worker whose Function a Policy forbids to read one is not ready.
sqlarray of Job.spec.bindings.sql[]The SQLDatabases the code queries through ctx.sql, each under its alias. The binding grants reads; only the database's owner and the writers that a RolesAssignment names may write. A database that does not exist yet holds the Function in Pending with SQLDatabaseNotFound.

Job.spec.bindings.addon[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe name the handler calls the object by: ctx.addon.fetch takes it, and the worker gets FUNCD_ADDON_<ALIAS>_URL and FUNCD_ADDON_<ALIAS>_TOKEN for an HTTP SDK. Unique in the list.
objectstring, required, a DNS-1123 labelAn add-on object of the Function's namespace, declared by its App when an App holds the Function. A missing one holds the Function in Pending with AddonObjectNotFound.

Job.spec.bindings.blob[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe binding's name, unique in the list; code that reaches the prefix through ctx.blob passes it.
bucketstring, required, a DNS-1123 labelThe Bucket, in the same namespace, that holds the prefix.
prefixstring, required, a DNS-1123 labelThe prefix, by its name in the Bucket's prefixes.

Job.spec.bindings.job[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe name that the code passes to ctx.job.start and ctx.job.get. Unique in the list.
jobstring, required, a DNS-1123 labelA Job of the Function's namespace. While the Job is missing, a start on its alias answers 404, and a read still answers each run that a deleted Job left, until job.retention removes it.

Job.spec.bindings.kv[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe binding's name, unique in the list, which the code passes to ctx.kv.
storestring, required, a DNS-1123 labelThe KVStore, in the same namespace, that holds the table.
tablestring, required, a DNS-1123 labelThe table, by its name in the store's tables.

Job.spec.bindings.lake[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe binding's name, unique in the list. Each worker reads the Lake's address and its token from FUNCD_LAKE_<ALIAS>_URL and FUNCD_LAKE_<ALIAS>_TOKEN, the alias upper-cased.
lakestring, required, a DNS-1123 labelThe Lake to query, in the same namespace.
FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe link's name, unique in the list, which the code passes to ctx.invoke or ctx.fetch.
targetstring, required, a DNS-1123 labelThe Function to call, in the same namespace.
timeoutstring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)Bounds the synchronous call, a cold-start wake included: 0s to 5m; 0s or unset means the 30s link default.

Job.spec.bindings.sql[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe binding's name, unique in the list, which the code passes to ctx.sql.
databasestring, required, a DNS-1123 labelThe SQLDatabase to query, in the same namespace.

Job.spec.buckets[]

FieldType and limitsDescription
deletionstring, one of retain, deleteretain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
prefixesarray of Job.spec.buckets[].prefixes[]The Bucket's prefixes, each a key space with its own owner and cap. Prefix names are unique within the Bucket. A Function or a Lake that binds a prefix the Bucket does not list waits, with the reason BucketNotFound.
quotaobject, Job.spec.buckets[].quotaCaps on the Bucket's total size and on each object. While the Bucket has a size cap, funcd refuses to sign a presigned PUT URL for it, with 403.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.

Job.spec.buckets[].prefixes[]

FieldType and limitsDescription
namestring, required, a DNS-1123 labelThe prefix's name, unique within the Bucket. Over S3, it is the first segment of each object's key.
ownerobject, Job.spec.buckets[].prefixes[].ownerThe one Function, Lake or Job that may write the prefix, named with its kind, besides the writers that a RolesAssignment names. In a Bucket that a Function, a Lake or a Job declares by name, an omitted owner is that workload. In a Workflow's buckets, a Function owner names a step and a Lake owner a lake that the Workflow declares. The prefix that a Site serves its bundle from must have no owner, since the Site writes its builds there; the prefixes of a Site's ingress rules may have one.
quotaobject, Job.spec.buckets[].prefixes[].quotaA cap on the prefix's total size: a write into the prefix must fit both this cap and the Bucket's, and while it is set funcd refuses to sign a presigned PUT URL into the prefix, with 403. It also caps a Lake's files under the prefix, though not the Lake's catalog.

Job.spec.buckets[].prefixes[].owner

FieldType and limitsDescription
kindstring, required, one of Function, Lake, JobThe workload's kind. A Function, a Lake and a Job may share a name, so the kind says which one it is; each field names the kinds it accepts.
namestring, required, a DNS-1123 labelThe workload's name, in the object's namespace.

Job.spec.buckets[].prefixes[].quota

FieldType and limitsDescription
maxBytesinteger, at least 0The same cap as a number of bytes. Set maxSize or maxBytes, not both.
maxSizestring, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.

Job.spec.buckets[].quota

FieldType and limitsDescription
maxBytesinteger, at least 0The same cap as a number of bytes. Set maxSize or maxBytes, not both.
maxObjectBytesinteger, at least 0The largest object a write may store, in bytes. A larger write gets 413, or EntityTooLarge over S3, and while it is set funcd refuses to sign a presigned PUT URL for the Bucket, with 403. 0 sets no cap of the Bucket's own, so only funcd's upload limits apply, such as s3gateway.maxUploadBytes.
maxSizestring, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.

Job.spec.configMaps[]

FieldType and limitsDescription
datamap of string to stringKeys and their string values, for settings that are not secret. Each key is an environment variable name: ASCII letters, digits and _, not starting with a digit. Each value must be UTF-8 text with no NUL byte: a Function or a Lake that binds a ConfigMap holding another value does not start. Each worker of a Function that lists the ConfigMap in bindings.config gets each key as an environment variable when it starts, except a key that starts with FUNCD_ or that a bound Secret also holds; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of the ConfigMap's. A Lake that lists it gives its engine only the keys that the Lake's bindings.config lets through.
namestring, a DNS-1123 labelThe ConfigMap's name, at most 52 characters. It is stored as <name>-<hash of data>, and the config of each part that names it is set to that stored name.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.

Job.spec.kv[]

FieldType and limitsDescription
deletionstring, one of retain, deleteretain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
quotaobject, Job.spec.kv[].quotaCaps on the store's total size, on each value and on each key.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.
tablesarray of Job.spec.kv[].tables[]The store's tables. A table is a key space that only its owner and the writers that a RolesAssignment names may write. Table names are unique within the store, and a store with no table has nothing a Function can write.

Job.spec.kv[].quota

FieldType and limitsDescription
maxBytesinteger, at least 0The same cap as a number of bytes. Set maxSize or maxBytes, not both.
maxKeyBytesinteger, 0 to 64000The longest key, in bytes. 0 means 1024 (1 KiB).
maxSizestring, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.
maxValueBytesinteger, 0 to 1048576The largest value a write may store, in bytes. 0 means 1048576 (1 MiB).

Job.spec.kv[].tables[]

FieldType and limitsDescription
namestring, required, a DNS-1123 labelThe table's name, unique within the store.
ownerobject, Job.spec.buckets[].prefixes[].ownerThe Function or Job that owns the table, in the store's namespace, named with its kind. The owner writes the table, and so does a principal that a RolesAssignment grants kv::write on the table, its store or its namespace, such as the KV Data Writer role. In a store that a Function or a Job declares, the owner defaults to that workload; in one that a Workflow declares, a Function owner names a step, and the Function that funcd creates for that step is the owner; in a KVStore applied on its own, a table with no owner is written only through such a grant. Every workload, the owner included, reaches the table through an entry of its spec.bindings.kv.

Job.spec.lakes[]

FieldType and limitsDescription
bindingsobject, Job.spec.lakes[].bindingsWhat the Lake's engine uses: Bucket prefixes, and the ConfigMaps and Secrets of its environment.
bucketsarray of Job.spec.lakes[].buckets[]The Buckets that a Lake applied on its own declares: by name the Lake creates the Bucket, an omitted prefix owner being the Lake, and a Bucket of that name that is not the Lake's holds it in Pending with StoreNotOwned; by ref it binds an existing one. Each Bucket that the Lake's bindings.blob names must be declared here. A lake that another resource declares sets none.
configMapsarray of Job.spec.lakes[].configMaps[]The ConfigMaps that a Lake applied on its own declares: by name the Lake defines one, and a ConfigMap of its stored name that is not the Lake's holds it in Pending with StoreNotOwned; by ref it binds an existing one. Each ConfigMap that the Lake's bindings.config names must be declared here. A lake that another resource declares sets none.
ingressobject, Job.spec.lakes[].ingressExposes the Lake gateway at the edge, only when enabled is true and while the Lake is Ready. The path defaults to /lake/<name>, or / with a host. Setting auth is refused, since the Lake gateway checks each caller itself.
locationobject, Job.spec.lakes[].locationThe Bucket prefix that holds the Lake's files, one of the Lake's bindings.blob. The Lake waits in Pending, with the reason PrefixNotOwned, until the prefix's owner is this Lake. The Lake's catalog is kept outside the Bucket, under the same location, so a Lake located where another was finds that Lake's files and catalog.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.
resourcesobject, Job.spec.resourcesThe cpu and memory of the Lake's engine. An empty cpu or memory sets no limit on it, and a change replaces the running engine.
secretsarray of Job.spec.lakes[].secrets[]The Secrets that a Lake applied on its own declares, with the keys its engine reads. Each Secret that the Lake's bindings.secret names must be declared here, and the Lake waits in Pending, with SecretNotFound or SecretKeyMissing, while one is missing or lacks a key. A lake that another resource declares sets none.

Job.spec.lakes[].bindings

FieldType and limitsDescription
blobarray of Job.spec.bindings.blob[], requiredThe Bucket prefixes the engine may read, each under an alias. It writes only a prefix whose owner is this Lake, and the Lake's location must be one of them.
configarray of string values, each a DNS-1123 labelConfigMaps whose data the engine gets as environment variables. Only QUACK_TOKEN and the DUCKDB_ keys pass, DUCKDB_EXTENSION_DIRECTORY excepted, and a bound Secret's value wins over a ConfigMap's for the same key. A missing ConfigMap holds the Lake in Pending, with the reason BindingResolveFailed.
secretarray of string values, each a DNS-1123 labelSecrets whose data the engine gets as environment variables, such as its QUACK_TOKEN; the same keys pass as for config. funcd asks Cedar, as the Lake, for secret::read on each: a forbidden Secret holds the Lake in Pending, with the reason BindingResolveFailed, as does a missing one in a lake that another resource declares. A changed value replaces the engine.

Job.spec.lakes[].buckets[]

FieldType and limitsDescription
deletionstring, one of retain, deleteretain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
prefixesarray of Job.spec.buckets[].prefixes[]The Bucket's prefixes, each a key space with its own owner and cap. Prefix names are unique within the Bucket. A Function or a Lake that binds a prefix the Bucket does not list waits, with the reason BucketNotFound.
quotaobject, Job.spec.buckets[].quotaCaps on the Bucket's total size and on each object. While the Bucket has a size cap, funcd refuses to sign a presigned PUT URL for it, with 403.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.

Job.spec.lakes[].configMaps[]

FieldType and limitsDescription
datamap of string to stringKeys and their string values, for settings that are not secret. Each key is an environment variable name: ASCII letters, digits and _, not starting with a digit. Each value must be UTF-8 text with no NUL byte: a Function or a Lake that binds a ConfigMap holding another value does not start. Each worker of a Function that lists the ConfigMap in bindings.config gets each key as an environment variable when it starts, except a key that starts with FUNCD_ or that a bound Secret also holds; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of the ConfigMap's. A Lake that lists it gives its engine only the keys that the Lake's bindings.config lets through.
namestring, a DNS-1123 labelThe ConfigMap's name, at most 52 characters. It is stored as <name>-<hash of data>, and the config of each part that names it is set to that stored name.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.

Job.spec.lakes[].ingress

FieldType and limitsDescription
authobject, Job.spec.lakes[].ingress.authHow the edge checks callers at the resource's own address; unset, the namespace's spec.edgeDefaults.auth decides, else open. A Lake refuses it, since the Lake gateway checks each caller.
enabledbooleanTurns the resource's own address on or off. Unset, it is on unless the namespace's spec.defaultExposure is explicit; a Lake's address is on only when this is true.
hoststringThe exact host of the resource's own address. Empty is the namespace's host, <namespace>.<server.baseDomain>, or, in the default namespace, any host that no other namespace reserves.
pathstringThe edge path of the resource's own address, which begins with / and does not end with / unless it is /. Empty is / when host is set, else /function/<name>, /site/<name> or /lake/<name> by kind.

Job.spec.lakes[].ingress.auth

FieldType and limitsDescription
modestring, one of "", authenticated, open, oidcHow the edge checks callers. authenticated requires a bearer token, or an X-Api-Key header, of an identity that RBAC lets get Functions in the namespace: 401 without a valid one, 403 when it may not; while server.auth.edge is off, every caller gets 401. open lets anonymous callers in. oidc signs callers in with the OIDCProvider that provider names, and passes the signed-in user to the code behind it in the X-Funcd-Principal headers. Empty takes the enclosing stance, if any, else the namespace's spec.edgeDefaults.auth.mode, else open.
providerstring, a DNS-1123 labelWith mode oidc, the OIDCProvider of the namespace that signs callers in; required with oidc and refused with another mode.
unauthenticatedstring, one of "", redirect, 401, allowWith mode oidc, what a call that is not signed in gets: redirect, the default, sends a GET or HEAD navigation to the provider with 302 and gives any other call 401; 401 gives every such call 401; allow passes every call, with no principal. Refused with another mode.

Job.spec.lakes[].location

FieldType and limitsDescription
bucketstring, required, a DNS-1123 labelA Bucket of the same namespace.
prefixstring, required, a DNS-1123 labelA prefix of that Bucket.

Job.spec.lakes[].secrets[]

FieldType and limitsDescription
descriptionstringWhat the Secret is for, for the installer who provides it.
keysarray of string values, required, each matching ^[A-Za-z_][A-Za-z0-9_]*$The keys read from the Secret: its data must hold each of them.
namestring, required, a DNS-1123 labelThe name of a Secret in the namespace of the resource that declares it. funcd holds its value; the resource never writes it.

Job.spec.resources

FieldType and limitsDescription
cpustringThe CPU cap of the worker or engine it sizes, as a number of cores of at least 0.01, such as 0.5 or 2. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it.
memorystringThe memory cap of the worker or engine it sizes, such as 256Mi or 4GiB: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B, above zero. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it, and there a worker that uses more memory than the cap is killed.

Job.spec.secrets[]

FieldType and limitsDescription
descriptionstringWhat the Secret is for, for the installer who provides it.
keysarray of string values, required, each matching ^[A-Za-z_][A-Za-z0-9_]*$The keys read from the Secret: its data must hold each of them.
namestring, required, a DNS-1123 labelThe name of a Secret in the namespace of the resource that declares it. funcd holds its value; the resource never writes it.

Job.spec.sql[]

FieldType and limitsDescription
deletionstring, one of retain, deleteretain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
ownerobject, Job.spec.buckets[].prefixes[].ownerThe one Function, Lake or Job that may write the database, in its namespace, named with its kind, besides the writers that a RolesAssignment names. In a database that a Function or a Job declares by name, it defaults to that workload, and in a Workflow's sql a Function owner names a step and a Lake owner a lake that the Workflow declares. A Lake writes no SQL, so a database a Lake owns is written by those writers only. With no owner, only those writers can write it.
quotaobject, Job.spec.buckets[].prefixes[].quotaA cap on the database's total size, the bytes of its pages in use. Once it is reached, an execute gets 507 unless each of its statements is a DELETE or a DROP. A change keeps the engine running.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.
resourcesobject, Job.spec.resourcesThe cpu and memory of the database's engine. An empty memory means 256Mi, and an empty cpu sets no cpu limit. A change replaces the running engine.

Job.spec.volumes[]

FieldType and limitsDescription
deletionstring, one of retain, deleteOnly for a local volume declared by name: retain, the default, keeps the volume and its files with no owner when the Function drops it or is deleted, so that a ref can take it again; delete removes them.
namestring, a DNS-1123 labelThe volume's name, unique in the list; set name or ref, not both. The code reads the directory's path from FUNCD_VOLUME_<NAME>, the name or ref upper-cased.
refstring, a DNS-1123 labelInstead of name: a retained local volume that this Function, or an earlier Function of the same name, dropped with retain, and that the Function takes over; with no such volume, it waits in Pending with VolumeNotFound. Only a local volume takes a ref; it sets no deletion and states the retained volume's own size, since apply refuses another size.
sizestring, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)The volume's size, the most its directory may hold, above zero; set size or sizeBytes, not both. Apply refuses a local volume whose size changes, or that does not fit both the capacity that volumes.capacity or volumes.capacityBytes sets and the namespace's spec.volumeBudget.
sizeBytesinteger, at least 1The same size as a number of bytes. Set size or sizeBytes, not both.
typestring, required, one of emptyDir, localemptyDir is a new empty directory for each worker, removed with it; local is one durable directory that keeps its files through a crash, a redeploy and a scale to zero. A Function with a local volume runs at most 1 replica, and while it redeploys, its old and new workers hold the volume at once.

Job.status

FieldType and limitsDescription
conditionsarray of ConditionThe conditions that explain the phase.
contractobject, Job.status.contractThe input and output schemas of the current Revision's image, read by its digest. A new run's input is checked against the input schema; an image with none holds the Job with ContractMissing.
currentRevisionstring, a DNS-1123 labelThe Revision of the latest spec, named <job>-v<generation>. A run pins the current one when it starts, and keeps it until it ends.
observedGenerationintegerThe generation of the spec that funcd last acted on.
phasestring, one of Pending, Deploying, Ready, Idle, Degraded, Failed, TerminatingWhere the object is in its lifecycle.

Job.status.contract

FieldType and limitsDescription
dialectstringThe URI of the JSON Schema dialect that input and output follow. funcd checks nothing against it.
inputany JSON valueThe JSON Schema of the input. A declared one must be an object, and each property it does not require must declare a default.
outputany JSON valueThe JSON Schema of the output. A declared one must be an object, and each property it does not require must declare a default.

JobRun

apiVersion: funcd.io/v1alpha1
kind: JobRun
metadata:
  name: report-2026-10
  namespace: default
  resourceGroup: rg1
spec:
  job: report
  input:
    month: "2026-10"
apiVersionkind
funcd.io/v1alpha1JobRun

JobRun.spec

FieldType and limitsDescription
approvestring, a sha256 digestThe digest of the preview that a person approves, status.preview.digest. A create that sets it is refused. An update that sets or changes it, or that keeps one with no recorded approval of the run's current preview, is taken only while the run is AwaitingApproval and the digest is the run's preview's, else it is refused with 409, and only from a caller who may update the run's Job, else with 403; an update that cancels or rejects the run is taken whatever it holds. It is never cleared. funcdctl job approve sets it.
cancelbooleanWhen true, the run is cancelled: a run that has not started ends Cancelled, and a running one has its worker stopped first, though its handler may have done part of its work. It may only turn true, and a run that has ended ignores it. funcdctl job cancel sets it.
inputany JSON valueThe run input, the data of the event that the handler receives. Over job.payloadLimit bytes, or off the input schema in the Job's status.contract, it is refused when the run is created. It is fixed once the run is created.
jobstring, required, a DNS-1123 labelThe Job to run, in the run's namespace, fixed once the run is created. The run waits in Pending while that Job is missing or not Ready.
rejectbooleanWhen true, the run ends Rejected and its handler never runs. A create that sets it is refused. An update may turn it true only while the run is Pending, Previewing or AwaitingApproval, and only from a caller who may update the run's Job; it may not turn false again. A rejection wins over an approval that funcd has not acted on yet. funcdctl job reject sets it.
rejectReasonstring, 0 to 512 charactersWhy the run is rejected: the message of its Ready condition once it ends Rejected, at most 512 bytes, which a text of more than one byte per character reaches before 512 characters. It is set with spec.reject, and a create that sets it is refused.

JobRun.status

FieldType and limitsDescription
approvedAtstring, an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03
.965Z)
When a person approved the run's preview. funcd runs a run only on an approval it recorded.
approvedBystringThe subject of the credential that approved the run, which funcd sets with approvedAt; empty with none. A preview made again with another document clears both.
conditionsarray of ConditionThe conditions that explain the phase.
endedAtstring, an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03
.965Z)
When the run ended.
imageDigeststringThe digest of the image of the pinned Revision.
jobRevisionstring, a DNS-1123 labelThe Revision of the Job that the run runs, pinned when it starts: an edit of the Job during the run changes nothing for it.
jobUIDstringThe UID of the run's Job, set when the run is created if the Job exists, else when it starts. A run whose Job is deleted, or re-created under a new UID, is cancelled.
observedGenerationintegerThe generation of the spec that funcd last acted on.
phasestring, one of Pending, Previewing, AwaitingApproval, Running, Succeeded, Failed, Cancelled, RejectedWhere the run is: Pending while it waits for its Job or for a free slot, Previewing while its worker answers the code's preview, AwaitingApproval while it waits for a person to approve or reject that preview, and Running while its worker runs the handler. Succeeded, Failed, Cancelled and Rejected are final, and the Ready condition gives the reason.
previewobject, JobRun.status.previewThe answer of the code's preview, which a person approves by its digest. Empty for a run of a Job with approval.bypass.
rejectedBystringThe subject of the credential that rejected the run, which funcd sets; empty with none.
resultany JSON valueThe handler's answer, once the run Succeeded.
startedAtstring, an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03
.965Z)
When the run started running.
startedBystringWho started the run, which funcd sets: the subject of the credential that created it, empty when there was none, or, for a run that a Function started through its spec.bindings.job, the Function's Cedar principal, such as Function::"default/planner". It records who started the run and grants nothing.
traceIdstringThe run's W3C trace ID, 32 lowercase hex characters, the same for its preview and its run. funcdctl job logs reads the run's logs by it.

JobRun.status.preview

FieldType and limitsDescription
digeststring, requiredsha256: and the hex digest of the preview's bytes, which spec.approve names.
documentany JSON value, requiredThe JSON document that the preview answered, or the run's input when the code has no preview.
previewedAtstring, required, an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03
.965Z)
When the preview answered. A preview older than its Job's approval.expiry is previewed again when it is approved, or when its run's slot frees after the approval.

Handler API

The methods a handler calls on its context's clients, in each language funcd ships a shim for.

ctx

The per-invocation context the shim passes to the handler.

MethodWhat it does
log(...args: unknown[]): voidWrites the arguments as one log line at level INFO, as console.log does.
invoke<I = unknown, O = unknown>(alias: string, input: I): Promise<O>Calls the function that the link named alias targets, and returns its result parsed from JSON, or null when it returns nothing. The target's event.data is input, except that an object with a top-level data or specversion key is taken as the whole CloudEvent, so event.data is only its data: send such an object inside an envelope, as { specversion: '1.0', data: { data: [1], page: 2 } }. The link's timeout, 30 seconds by default, bounds the call. Fails with the HTTP status 403 when the function declares no link named alias, 409 when the target serves HTTP, 422 when input does not match the target's contract, and the target's status when its handler fails, such as 500.
fetch(alias: string, path: string, init?: RequestInit): Promise<Response>Sends an HTTP request to the function that the link named alias targets, which serves HTTP, and returns its reply as a Response, whatever its status. path starts with "/" and may carry a query; init sets the method, the headers and the body, as for the global fetch. The request body and the reply are each at most 1 MiB, and the link's timeout, 30 seconds by default, bounds the call. Fails with the HTTP status 403 when the function declares no link named alias, and 409 when the target does not serve HTTP.
remainingMs(): number | nullThe whole milliseconds left before the call's deadline, 0 once it has passed, or null when the call has none.

Each method here that calls funcd can also fail with the status 500 and the problem type urn:funcd:problem:internal, when funcd meets an error that it did not expect; funcd logs its cause.

When funcd refuses a call, the method fails with an error that holds funcd's status and problem type. This table gives them for each method, with when each happens and what to do.

MethodStatusProblem typeWhenWhat to do
invoke403urn:funcd:problem:forbiddenThe Function's spec.bindings.links has no entry for the alias.Add the link to spec.bindings.links, or call an alias that the Function links.
invoke403urn:funcd:problem:forbiddenA Policy forbids the Function to call the link's target.Change or remove the Policy that forbids link::invoke on the target.
invoke404urn:funcd:problem:not-foundThe Function that the link targets no longer exists, as when its App deleted it before the Function that links it.Create the Function again, or link one that exists.
invoke409urn:funcd:problem:conflictThe link's target serves HTTP, which ctx.invoke does not call.Call it with ctx.fetch, which only the TypeScript shim has, or link a Function whose protocol is cloudevent.
invoke413urn:funcd:problem:payload-too-largeThe request's body is larger than the local API takes for the call.Send a smaller body.
invoke413urn:funcd:problem:payload-too-largeThe target's reply is larger than 1 MiB, the most that a call carries back.Return a smaller reply, or pass the data through a Bucket.
invoke429urn:funcd:problem:resource-exhaustedThe target already has as many calls from Functions in flight as invoke.maxNestedInFlight allows.Retry once a call to the target returns, or raise invoke.maxNestedInFlight.
invoke503urn:funcd:problem:unavailableThe target's reply broke off before its end: its worker failed during the call, or the link's timeout ended it.Retry the call, and raise the link's timeout if the target needs longer.
fetch403urn:funcd:problem:forbiddenThe Function's spec.bindings.links has no entry for the alias.Add the link to spec.bindings.links, or call an alias that the Function links.
fetch403urn:funcd:problem:forbiddenA Policy forbids the Function to call the link's target.Change or remove the Policy that forbids link::invoke on the target.
fetch404urn:funcd:problem:not-foundThe path names no alias: it is not /fetch/<alias>/<path>.Pass the alias of a link, and a path that starts with /.
fetch404urn:funcd:problem:not-foundThe Function that the link targets no longer exists, as when its App deleted it before the Function that links it.Create the Function again, or link one that exists.
fetch409urn:funcd:problem:conflictThe link's target does not serve HTTP, which ctx.fetch needs.Call it with ctx.invoke, or link a Function whose protocol is http.
fetch413urn:funcd:problem:payload-too-largeThe request's body is larger than the local API takes for the call.Send a smaller body.
fetch413urn:funcd:problem:payload-too-largeThe target's reply is larger than 1 MiB, the most that a call carries back.Return a smaller reply, or pass the data through a Bucket.
fetch429urn:funcd:problem:resource-exhaustedThe target already has as many calls from Functions in flight as invoke.maxNestedInFlight allows.Retry once a call to the target returns, or raise invoke.maxNestedInFlight.
fetch503urn:funcd:problem:unavailableThe target's reply broke off before its end: its worker failed during the call, or the link's timeout ended it.Retry the call, and raise the link's timeout if the target needs longer.

ctx.job

The Jobs that the function binds, by alias: start a run of one with an input, and read a run back.

MethodWhat it does
start(alias: string, input?: unknown, name?: string): Promise<string>Starts a run of the Job that the function binds under alias, with input as the run's input, and returns the run's name at once, without waiting for the run. Without name, funcd names the run <job>-<id>, and a start sent again starts a second run; with name, a start sent again with the same input returns that run, so a function called more than once for one event, as at-least-once delivery does, names the run from the event's id. A run of a Job without approval.bypass waits for a person's approval. Rejects with a JobError: 403 when the function binds no Job under alias or a Policy forbids it, 404 when the Job does not exist, 409 when another run holds the name, 413 when the input passes job.payloadLimit, and 422 when it does not match the Job's input schema.
get(alias: string, run: string): Promise<JobRunState>Reads run, a run of the Job that the function binds under alias: its phase, its reason, its times and, once it Succeeded, its result. Rejects with a JobError: 403 when the function binds no Job under alias or a Policy forbids it, and 404 when the run is not one of that Job's, or funcd removed it after job.retention.

Each method here that calls funcd can also fail with the status 500 and the problem type urn:funcd:problem:internal, when funcd meets an error that it did not expect; funcd logs its cause.

When funcd refuses a call, the method fails with an error that holds funcd's status and problem type. This table gives them for each method, with when each happens and what to do.

MethodStatusProblem typeWhenWhat to do
start400urn:funcd:problem:invalidThe body of the start is not {"input": <JSON>, "name": "<run>"}, or the name is not a DNS-1123 name.Send the input as JSON, and a name of lowercase letters, digits and dashes, or no name.
start403urn:funcd:problem:forbiddenThe Function binds no Job under the alias.Start or read a run under an alias of spec.bindings.job, or add the alias there.
start403urn:funcd:problem:forbiddenCedar denies the Function job::start or job::read on the bound Job, as when a namespace Policy forbids it.Ask the operator to lift the forbid.
start404urn:funcd:problem:not-foundThe Job that the alias binds does not exist.Create the Job, or bind a Job that exists.
start409urn:funcd:problem:conflictAnother run of the namespace holds the name: a run of another Job, or one with another input.Start the run under another name, or with no name, so that funcd names it.
start413urn:funcd:problem:payload-too-largeThe request's body is larger than the local API takes for the call.Send a smaller body.
start413urn:funcd:problem:payload-too-largeThe run's input is larger than job.payloadLimit.Pass large data by reference, such as the key of an object in a Bucket.
start422noneThe input does not match the Job's input schema: funcd answers as a Function's call answers an input off its contract, with the contract's {"error", "details"} body, which the error keeps as its detail.Send an input that the Job's contract takes.
get403urn:funcd:problem:forbiddenThe Function binds no Job under the alias.Start or read a run under an alias of spec.bindings.job, or add the alias there.
get403urn:funcd:problem:forbiddenCedar denies the Function job::start or job::read on the bound Job, as when a namespace Policy forbids it.Ask the operator to lift the forbid.
get404urn:funcd:problem:not-foundNo run of the bound Job has the name: the name is another Job's run's, or job.retention removed the run.Read a run that ctx.job.start returned, before job.retention removes it.

HTTP API

The table lists each described operation of these kinds, with its method and path. The operation's page in the API reference gives its parameters, its body, its authentication and every answer, with when it happens and what to do.

MethodPathOperation
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobsList the Jobs of a namespace
POST/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobsCreate a Job
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobs/{name}Read a Job
PUT/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobs/{name}Replace a Job
DELETE/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobs/{name}Delete a Job
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobrunsList the JobRuns of a namespace
POST/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobrunsCreate a JobRun
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobruns/{name}Read a JobRun
PUT/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobruns/{name}Replace a JobRun
DELETE/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobruns/{name}Delete a JobRun
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/jobruns/{name}/logsRead the logs of a JobRun

On this page