> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/types/temporalmetadata.md).

# TemporalMetadata

TemporalMetadata Type

Audience: Programmer

The TemporalMetadata type represents a key-value pair used to store metadata information for Temporal workflows, particularly in search attributes.

## Fields

| Field   | Type      | Description                    |
| ------- | --------- | ------------------------------ |
| `key`   | `String!` | The metadata key identifier    |
| `value` | `String!` | The metadata value as a string |

## Usage Context

TemporalMetadata is used for:

* **Workflow Search Attributes**: Used in workflow queries to access indexed workflow metadata
* **Workflow Filtering**: Enables searching and filtering workflows based on custom attributes

## Usage Example

```graphql
query GetWorkflowDetails {
  workflow(id: "wf_12345") {
    id
    type
    searchAttributes {
      key
      value
    }
  }
}
```

## JavaScript Example

```javascript
// Accessing workflow search attributes
const response = await client.query({
  query: gql`
    query GetWorkflow($id: ID!) {
      workflow(id: $id) {
        id
        type
        searchAttributes {
          key
          value
        }
      }
    }
  `,
  variables: {
    id: "wf_12345"
  }
});

// Process search attributes into a map
const searchAttrs = response.data.workflow.searchAttributes;
const attributesMap = searchAttrs.reduce((acc, item) => {
  acc[item.key] = item.value;
  return acc;
}, {});

console.log('Workflow search attributes:', attributesMap);
```

## Common Search Attribute Keys

While search attribute keys are workflow-specific, common patterns include:

| Key         | Purpose                         |
| ----------- | ------------------------------- |
| `tenant_id` | Multi-tenant identifier         |
| `user_id`   | User who initiated the workflow |
| `trace_id`  | Distributed tracing identifier  |
| `priority`  | Workflow execution priority     |
| `source`    | Origin system or service        |
| `status`    | Custom workflow status          |

## Notes

* All values are stored as strings regardless of original type
* Search attributes are indexed and can be used for workflow queries
* Used for filtering, monitoring, and debugging workflows
* Available across all pyck services that use Temporal workflows
* Defined in the `temporalworkflow.graphql` schema across services


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/types/temporalmetadata.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
