# Action Context

The context object contains data related to the Workspace that you can use inside the action. The properties depends on the [Action Type](/2.21.0/user-guide/workspaces/actions/developing-actions/action-types.md).

{% hint style="info" %}
Tip

Inside your action you can use console.log(context) to quickly explore the available properties for the context
{% endhint %}

## **context.workspace**

Contains the workspace information in the Terrakube api format. See the [docs](/2.21.0/api/methods/workspace.md) for more details on the properties available.

#### Examples

* **context.workspace.id**: Id of the workspace
* **context.workspace.attributes.name**: Name of the workspace
* **context.workspace.attributes.terraformVersion**: Terraform version

#### Available for action types

* workspace/action
* workspace/resourcedrawer/action
* workspace/resourcedrawer/tab

## **context.settings**

Contains the settings that you configured in the display criteria.

#### Examples

* **context.settings.Repository:** the value of repository that you set for the setting. Example:

<figure><img src="/files/n9Q33e14yn6Zje2Te6hL" alt=""><figcaption></figcaption></figure>

#### Available for action types

* workspace/action
* workspace/resourcedrawer/action
* workspace/resourcedrawer/tab

## **context.state**

For `workspace/action` this property contains the full terraform or open tofu state. For `workspace/resourcedrawer/action` and `workspace/resourcedrawer/tab` contains only the section of the resource

#### Available for action types

* workspace/action
* workspace/resourcedrawer/action
* workspace/resourcedrawer/tab

## **context.apiUrl**

Contains the Terrakube api Url. Useful if you want to use the [Action Proxy ](/2.21.0/user-guide/workspaces/actions/developing-actions/action-proxy.md)or execute a call to the Terrakube API.

#### Available for action types

* workspace/action
* workspace/resourcedrawer/action
* workspace/resourcedrawer/tab


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.terrakube.io/2.21.0/user-guide/workspaces/actions/developing-actions/action-context.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
