Skip to content

Egress Sinks ​

When an AgentRun reaches a terminal phase (Succeeded or Failed), the controller can publish the final result to an external message bus. This is configured via spec.egress on the AgentRun CRD and is independent of webhook callbacks — both can be configured simultaneously.

Supported sinks ​

TypeProviderDelivery guarantee
kafkaApache KafkaAt-least-once (producer acks = 1), keyed by run ID for ordering
pubsubGoogle Cloud Pub/SubAt-least-once
redisRedis StreamsAt-most-once (fire-and-forget)

Configuration ​

FieldTypeRequiredDescription
typestringyeskafka, pubsub, or redis
topicstringyesDestination topic/stream name
brokers[]stringkafka onlyBroker addresses (e.g. ["kafka:9092"])
projectIDstringpubsub onlyGCP project ID
addressstringredis onlyRedis connection address (e.g. redis-master:6379)
secretRefSecretKeyRefnoSecret containing sink credentials
keystringnoPartition key (kafka only; defaults to run ID)

Secret key conventions ​

The secretRef Secret must be in the same namespace as the AgentRun.

SinkRequired keys
Kafkasasl-username, sasl-password (or tls-cert, tls-key, tls-ca for TLS)
Pub/Subcredentials (service account JSON blob)
Redispassword

Examples ​

Kafka ​

yaml
apiVersion: agentorca.agentorca.io/v1alpha1
kind: AgentRun
metadata:
  name: hello-run
  namespace: tenant-acme
spec:
  agentRef: hello-agent
  input: "Say hello to the world"
  egress:
    type: kafka
    topic: agent-results
    brokers:
      - kafka-cluster-kafka-bootstrap.kafka:9092
    secretRef:
      name: kafka-creds
      key: sasl-password
      namespace: tenant-acme

Pub/Sub ​

yaml
spec:
  egress:
    type: pubsub
    topic: agent-results
    projectID: my-gcp-project
    secretRef:
      name: pubsub-creds
      key: credentials
      namespace: tenant-acme

Redis ​

yaml
spec:
  egress:
    type: redis
    topic: agent-results       # Redis stream name
    address: redis-master:6379
    secretRef:
      name: redis-creds
      key: password
      namespace: tenant-acme

Published payload ​

The EgressResult payload is self-contained (no HATEOAS links) and includes:

FieldDescription
runIdAgentRun name
agentAgent name invoked
phaseTerminal phase: "Succeeded" or "Failed"
outputFinal output (up to 1 MiB)
costUSDTotal LLM cost for this run

Metrics ​

MetricTypeLabelsDescription
agentorca_egress_published_totalCountersink_typeSuccessfully published results
agentorca_egress_failed_totalCountersink_typeFailed publishes

AgentDeployment input sources ​

Long-running AgentDeployment resources can receive input from different sources. This is configured via spec.inputSource:

TypeDescription
chat (default)API-driven — each message spawns an AgentRun
queueRedis or other queue — polls for input messages
pubsubKafka or Pub/Sub — subscribes to an input topic
loopSelf-managed — the deployment manages its own input loop

Example:

yaml
apiVersion: agentorca.agentorca.io/v1alpha1
kind: AgentDeployment
metadata:
  name: support-bot
  namespace: tenant-acme
spec:
  agentRef: support-bot
  inputSource:
    type: pubsub
    config:
      provider: kafka
      brokers: "kafka:9092"
      topic: agent-input

Released under the Apache 2.0 License.