> ## Documentation Index
> Fetch the complete documentation index at: https://docs.worldvisagroup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Applying context

> Apply contexts in WorldVisa workflows to personalize notification templates, control workflow logic, and customize per-tenant behavior in the Inbox.

Contexts let you personalize how notifications are rendered and delivered by making contextual data available inside template editors, step conditions, and the `<Inbox />` component.

## How to use context

Once a context is created either through the WorldVisa dashboard or API, its data becomes available for use in your templates editors, step conditions, and for customizing the `<Inbox />` component.

### Using context data in the template editor

Use the `{{context}}` Handlebars helper to access context data in any template editor. The context key you provide while creating the context (for example, tenant, region) becomes the accessor.

For example, if a context with this data is created:

```json theme={null}
{
  "context": {
    "tenant": {
      "id": "acme-corp",
      "data": {
        "name": "Acme Corporation",
        "plan": "enterprise"
      } 
    }
  }
}
```

You can access the `name` and `plan` in your in-app, email, SMS, or push template like this:

```html theme={null}
<p>Welcome, new user from {{context.tenant.data.name}}!</p>
<p>Your account is on the {{context.tenant.data.plan}} plan.</p>
```

Or

```text theme={null}
Welcome, new user from {{context.tenant.data.name}}!
Your account is on the {{context.tenant.data.plan}} plan.
```

> [!NOTE]
>
> Refer to the Inbox documentation, to learn how to use context in the `<Inbox />` component.

### Using context in step conditions

You can use context variables in the **Step conditions** tab of a workflow step to add conditional logic to your notifications. For example, only send a "Feature X is now enabled" email if `context.tenant.data.plan` is `enterprise`.

![Context step conditions](https://mintcdn.com/wv-enterprise/nfMqNpG3TRk8Yj_D/images/developers/workflows/context-step-conditions.png?fit=max\&auto=format\&n=nfMqNpG3TRk8Yj_D\&q=85\&s=a4ab8f955926df3bf58339c556246cbb)

To learn how contexts are structured or how to define them, refer to the [Managing Contexts](https://docs.worldvisagroup.com/developers/workflow/advanced-features/contexts/manage-contexts.md) documentation.

## Viewing and debugging contexts

Once you start using contexts in your workflows, WorldVisa provides full observability so you can monitor and debug your context usage after a workflow has been triggered.

### Searching for workflow runs

You can filter your workflow runs to find all executions associated with a specific context.

1. Navigate to the **Activity Feed** in your WorldVisa dashboard.
2. Select the **Workflow Runs** tab.
3. In the search bar, click **Context** and enter the context `type` and `id` using the format `type:id`.

![Searching for workflow runs](https://mintcdn.com/wv-enterprise/nfMqNpG3TRk8Yj_D/images/developers/workflows/search-context-activityfeed.png?fit=max\&auto=format\&n=nfMqNpG3TRk8Yj_D\&q=85\&s=c06ba2a0a2bf7eb20e48f02629775b36)

### Verifying the resolved context

To confirm that WorldVisa received and processed your context data correctly, you can inspect the API traces for a specific run.

1. From the **Activity Feed**, select the relevant workflow run from the list in the **Requests** tab.
2. In the workflow run details, go to the **API Traces** tab.

Here, you will see the full context object that was resolved and attached to that specific workflow execution.

![Verifying the resolved context](https://mintcdn.com/wv-enterprise/nfMqNpG3TRk8Yj_D/images/developers/workflows/resolved-context.png?fit=max\&auto=format\&n=nfMqNpG3TRk8Yj_D\&q=85\&s=d147f9a9ce6a5e9ceb317eac9426ca44)


## Related topics

- [Inbox with Context](https://docs.worldvisagroup.com/developers/inbox/configuration/inbox-with-context.md)
- [Multi-tenancy](https://docs.worldvisagroup.com/developers/inbox/advanced-features/multi-tenancy.md)
- [How do contexts work in WorldVisa?](https://docs.worldvisagroup.com/developers/concepts/contexts.md)
- [Trigger](https://docs.worldvisagroup.com/developers/concepts/trigger.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.