ork functions
Create, update, and manage functions over Pulsar or Kafka in Orca Agent Engine with the ork functions commands.
The ork functions commands manage functions over Pulsar or Kafka through the Workspace registry API. A function processes messages from one or more input topics and optionally writes results to an output topic. Its connection selects the messaging protocol. These commands require the cloud.sn.io extension and are unavailable on a self-hosted engine.
Commands read --registry-url / ORCA_REGISTRY_URL and exactly one credential: --access-token / ORCA_ACCESS_TOKEN or --api-key / ORCA_API_KEY. See ork CLI for setup.
ork functions
├── list List functions
├── get Get one function
├── create Create a function
├── update Update a function
├── delete Delete a function
├── start Start a function
├── stop Stop a function
├── restart Restart a function
├── status Get function runtime status
├── stats Get function runtime statistics
├── trigger Invoke a function once
└── state
├── get Read a state value
└── put Write a state valueork functions list
List the function names in the Workspace.
ork functions list [flags]| Flag | Shorthand | Default | Description |
|---|---|---|---|
--output | -o | text | Output format: text, json, or yaml. |
ork functions list -o json \
--registry-url "$ORCA_REGISTRY_URL" \
--access-token "$ORCA_ACCESS_TOKEN"ork functions get
Get one function's configuration by name.
ork functions get [name] [flags]| Flag | Shorthand | Default | Description |
|---|---|---|---|
--output | -o | text | Output format: text, json, or yaml. |
ork functions get word-count -o yamlork functions create
Create a function. Provide the function's identity (name, tenant, namespace), a package (one of --jar, --py, --go, or --function-type), and its messaging topology. You can supply all settings through flags, a --function-config-file, or a combination - flags override file values.
ork functions create [flags]A package source is required on create. The package selectors --function-type, --jar, --py, and --go are mutually exclusive.
The connection can come from --connection, --use-connection, or the connection field in the
--function-config-file.
For Kafka, select a connection of type kafka, use Kafka topic names in --inputs and --output,
and set the matching generic runtime through --custom-runtime-options. The
Kafka function example includes the
Python source file and a complete create command.
Identity and package flags
| Flag | Shorthand | Default | Description |
|---|---|---|---|
--fqfn | Fully Qualified Function Name (tenant/namespace/name). | ||
--tenant | public | The tenant of the function. | |
--namespace | default | The namespace of the function. | |
--name | The name of the function. | ||
--classname | The class name of the function. | ||
--function-type | -t | The built-in function type. | |
--jar | Path or URL to the function JAR package. | ||
--py | Path or URL to the function Python package. | ||
--go | Path or URL to the function Go binary. | ||
--function-config-file | Path to a function config YAML file. |
I/O and schema flags
| Flag | Shorthand | Default | Description |
|---|---|---|---|
--inputs | -i | Comma-separated input topics. | |
--topics-pattern | Topic pattern to consume from. | ||
--output | -o | The output topic of the function. | |
--producer-config | Custom producer configuration as JSON. | ||
--log-topic | Topic for function logs. | ||
--schema-type | Builtin schema type or output schema class name. | ||
--custom-serde-inputs | Map of input topics to SerDe class names as JSON. | ||
--custom-schema-inputs | Map of input topics to schema class names as JSON. | ||
--custom-schema-outputs | Map of output topics to schema properties as JSON. | ||
--input-specs | Map of inputs to custom consumer configuration as JSON. | ||
--input-type-class-name | The input type class name. | ||
--output-serde-classname | The output SerDe class name. | ||
--output-type-class-name | The output type class name. |
On ork functions, -o is the output topic (--output), not the rendering format. The create and update commands do not take a rendering-format flag; list, get, and status use -o / --output for text / json / yaml.
Processing and behavior flags
| Flag | Default | Description |
|---|---|---|
--processing-guarantees | Processing guarantees for the function. | |
--user-config | User-defined config as JSON. | |
--retain-ordering | false | Consume and process messages in order. |
--retain-key-ordering | false | Consume and process messages in key order. |
--batch-builder | Batch builder strategy. | |
--forward-source-message-property | true | Forward input message properties to the output topic. |
--subs-name | Specific subscription name for the input-topic consumer. | |
--subs-position | Subscription position to consume from. | |
--skip-to-latest | false | Skip to the latest message on function instance restart. |
--auto-ack | true | Enable auto ack. |
--cleanup-subscription | true | Delete the subscription when the function is deleted. |
--max-message-retries | 0 | Max message retries before sending to the dead letter topic. |
--dead-letter-topic | Dead letter topic. | |
--timeout-ms | 0 | Function timeout in milliseconds. |
--custom-runtime-options | JSON string with runtime options. Kafka functions require a matching genericKind; use kafkaConsumerConfig and kafkaProducerConfig for Kafka client properties. | |
--secrets | Function secrets as JSON. |
Resource and window flags
| Flag | Default | Description |
|---|---|---|
--parallelism | 0 | Parallelism factor. Defaults to 1 when unset. |
--cpu | 0 | CPU cores per function instance. |
--ram | 0 | RAM per function instance. |
--disk | 0 | Disk per function instance. |
--window-length-count | 0 | The number of messages per window. |
--window-length-duration-ms | 0 | The time duration of the window in milliseconds. |
--sliding-interval-count | 0 | The number of messages after which the window slides. |
--sliding-interval-duration-ms | 0 | The time duration after which the window slides. |
Connection flags
| Flag | Default | Description |
|---|---|---|
--connection | Pulsar or Kafka connection name. The connection selects the messaging protocol. | |
--use-connection | false | Interactively select a connection for the function. |
--sn-service-account | Service account identity used by the function. |
Example
ork functions create \
--registry-url "$ORCA_REGISTRY_URL" \
--access-token "$ORCA_ACCESS_TOKEN" \
--name word-count \
--tenant public \
--namespace default \
--function-type word_count \
--connection events-pulsar \
--inputs persistent://public/default/sentences \
--output persistent://public/default/word-counts \
--parallelism 1ork functions update
Update an existing function. The function name is a positional argument. If you also pass --name, it must match the positional argument. Pass only the flags you want to change.
ork functions update [name] [flags]update accepts every flag from create except --connection and --use-connection, which are create-only because a function's connection cannot change during an update. It also accepts:
| Flag | Default | Description |
|---|---|---|
--update-auth-data | false | Whether to update the auth data. |
ork functions update word-count \
--registry-url "$ORCA_REGISTRY_URL" \
--access-token "$ORCA_ACCESS_TOKEN" \
--parallelism 2ork functions delete
Delete a function by name.
ork functions delete [name]ork functions delete word-countork functions start, stop, restart
Control a function's runtime lifecycle. Pass the optional instance ID to operate on one instance; omit it to operate on every instance.
ork functions start [name] [instance-id]
ork functions stop [name] [instance-id]
ork functions restart [name] [instance-id]ork functions stop word-count
ork functions start word-count
ork functions restart word-countork functions status
Get aggregate status or one instance's status, including running state, restart counts, and errors.
ork functions status [name] [instance-id] [flags]| Flag | Shorthand | Default | Description |
|---|---|---|---|
--output | -o | text | Output format: text, json, or yaml. |
ork functions status word-count -o json \
--registry-url "$ORCA_REGISTRY_URL" \
--access-token "$ORCA_ACCESS_TOKEN"ork functions stats
Get aggregate statistics or one instance's statistics.
ork functions stats [name] [instance-id] [flags]| Flag | Shorthand | Default | Description |
|---|---|---|---|
--output | -o | text | Output format: text, json, or yaml. |
ork functions stats word-count -o jsonork functions trigger
Invoke a Pulsar function once with inline data or a file. Set exactly one of --data and --data-file;
--topic optionally selects the input topic.
Kafka functions return HTTP 400 for this operation. Publish a record to a Kafka input topic to invoke them.
ork functions trigger word-count --data '{"value": 1}'ork functions state
Read or write one state key.
ork functions state get [name] [key] [-o text|json|yaml]
ork functions state put [name] [key] --state-json <json>
ork functions state put [name] [key] --state-file <path>Set exactly one of --state-json and --state-file when writing.