---
title: Charmhub | Deploy Temporal Worker using Charmhub - The Open Operator Collection
description: Deploy the latest version of Temporal Worker as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer
---

# Temporal Worker

[Workflows Charmers](https://charmhub.io/publisher/workflows-charmers "View all packages from Workflows Charmers")

* [Workflows Charmers](https://charmhub.io/publisher/workflows-charmers "View all packages from Workflows Charmers")

Platform:

1.0/stable 39

```
juju deploy temporal-worker-k8s --channel 1.0/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

[Toggle side navigation](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#drawer)

## charms.temporal\_worker\_k8s.v0.temporal\_worker\_consumer

* [*Docstrings*Docstrings](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer)
  [*Code*Source code](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.temporal_worker_k8s.v0.temporal_worker_consumer
    ```

    [Download temporal\_worker\_consumer.py](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer/download)
  + *Last updated* 23 Apr 2026
  + *Revision* Library version 0.1

Charm library for the temporal-worker-info Juju relation.

`temporal-worker-info` parallels `temporal-host-info`: the worker charm **provides** the
namespace and task queue it serves so downstream charms know where to run workflows.

* Import :class:`TemporalWorkerInfoProvider` in the **temporal-worker** charm and
  instantiate it once; it publishes `namespace` and `queue` from config into each
  related application's relation data (leader only).
* Import :class:`TemporalWorkerInfoRequirer` in charms that relate to one or more workers.
  Use :meth:`TemporalWorkerInfoRequirer.is_ready` to decide when data is present; observe
  `on.temporal_worker_info_available` to react to updates. The importing charm should set
  unit status, not the library.

---

Index

* [class TemporalWorkerInfoProvider](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinfoprovider)
* + [def \_\_init\_\_(
    self,
    charm)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinfoprovider-__init__)
* [class TemporalWorkerInfoRelationReadyEvent](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforelationreadyevent)
* + [def \_\_init\_\_(
    self,
    handle,
    namespace,
    queue,
    relation\_id)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforelationreadyevent-__init__)
* + [def snapshot(
    self)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforelationreadyevent-snapshot)
* + [def restore(
    self,
    snapshot)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforelationreadyevent-restore)
* [class TemporalWorkerInfoRequirerCharmEvents](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirercharmevents)
* [class TemporalWorkerInfoRequirer](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirer)
* + [def \_\_init\_\_(
    self,
    charm)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirer-__init__)
* + [def relations(
    self)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirer-relations)
* + [def is\_ready(
    self,
    relation\_id)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirer-is_ready)
* + [def relation\_payloads(
    self)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirer-relation_payloads)
* + [def get\_namespace\_queue(
    self,
    relation\_id)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirer-get_namespace_queue)
* + [def namespace(
    self)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirer-namespace)
* + [def queue(
    self)](https://charmhub.io/temporal-worker-k8s/libraries/temporal_worker_consumer#temporalworkerinforequirer-queue)

#### class TemporalWorkerInfoProvider

Description

Publish namespace and queue on the temporal-worker-info interface (provider side). None

Methods

TemporalWorkerInfoProvider.
\_\_init\_\_(

*self*

,
charm: CharmBase
)

Create a new instance of the TemporalWorkerInfoProvider class.

Arguments

charm

The charm that is using this interface.

#### class TemporalWorkerInfoRelationReadyEvent

Event emitted when temporal-worker-info relation is ready for one relation.

Attributes

namespace

Temporal namespace from the provider application's relation data.

queue

Task queue name from the provider application's relation data.

relation\_id

Juju relation id for this event source, if multiple relations exist.

Methods

TemporalWorkerInfoRelationReadyEvent.
\_\_init\_\_(

*self*

,
handle: Handle

,
namespace: str

,
queue: str

,
relation\_id
)

Initialize temporal-worker-info ready event.

Arguments

handle

Event handle.

namespace

Temporal namespace from relation data.

queue

Worker queue from relation data.

relation\_id

Juju relation id when multiple worker relations exist.

TemporalWorkerInfoRelationReadyEvent.
snapshot(

*self*
)

Serialize event state for the framework.

Returns

Mapping with `namespace`, `queue`, and optional `relation_id` keys.

TemporalWorkerInfoRelationReadyEvent.
restore(

*self*

,
snapshot
)

Restore event state from a snapshot.

Arguments

snapshot

Data previously returned by :meth:`snapshot`.

#### class TemporalWorkerInfoRequirerCharmEvents

Events for the temporal-worker-info requirer.

Attributes

temporal\_worker\_info\_available

Fired when provider data is present for a relation.

#### class TemporalWorkerInfoRequirer

Requirer side: read namespace/queue published by temporal-worker (one or more relations).

Attributes

on

Custom events for this relation interface.

charm

The requirer :class:`~ops.charm.CharmBase` instance.

relations

All ``temporal-worker-info`` :class:`~ops.model.Relation` instances for this charm.

namespace

First complete namespace from a related worker; use :meth:`relation\_payloads` if
multiple workers are related.

queue

Task queue matching :attr:`namespace` from the same relation.

Methods

TemporalWorkerInfoRequirer.
\_\_init\_\_(

*self*

,
charm: CharmBase
)

Create a new instance of the TemporalWorkerInfoRequirer class.

Arguments

charm

The charm that is using this interface.

TemporalWorkerInfoRequirer.
relations(

*self*
)

Return all Juju relations for this interface name.

Returns

List of :class:`~ops.model.Relation` instances (may be empty).

TemporalWorkerInfoRequirer.
is\_ready(

*self*

,
relation\_id
)

Return whether namespace and queue are present in relation data.

Arguments

relation\_id

If set, only that relation is checked. If `None`, return
`True` when at least one related application has both keys set.

Returns

`True` if the requested scope has complete provider data.

TemporalWorkerInfoRequirer.
relation\_payloads(

*self*
)

Collect namespace and queue for every relation that has both keys.

Returns

Mapping from relation id to `{"namespace": ..., "queue": ...}`.

TemporalWorkerInfoRequirer.
get\_namespace\_queue(

*self*

,
relation\_id: int
)

Return namespace and queue for a specific relation id.

Arguments

relation\_id

Juju id of the `temporal-worker-info` relation instance.

Returns

`(namespace, queue)` from the remote application's data bag, or
`(None, None)` if the relation is missing or incomplete.

TemporalWorkerInfoRequirer.
namespace(

*self*
)

Namespace from the first related worker that has both keys set.

Returns

Namespace string, or `None` if no relation has complete data. For multiple
workers use :meth:`relation_payloads` or :meth:`get_namespace_queue`.

TemporalWorkerInfoRequirer.
queue(

*self*
)

Queue from the same relation as :attr:`namespace`.

Returns

Queue string, or `None` if no relation has complete data.
