# GraphExecutionContext

> **Class** in `langchain_google_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-community/callbacks/bigquery_callback/GraphExecutionContext)

Emits INVOCATION_STARTING/INVOCATION_COMPLETED for a graph run.

## Signature

```python
GraphExecutionContext(
    self,
    handler: BigQueryCallbackHandler,
    graph_name: str,
    metadata: Optional[Dict[str, Any]] = None,
)
```

## Description

**Usage:**

with handler.graph_context("my_graph") as ctx:
# Graph execution happens here
result = graph.invoke(inputs)

Emits INVOCATION_STARTING on enter and INVOCATION_COMPLETED on exit.
On exception, INVOCATION_ERROR is emitted instead of INVOCATION_COMPLETED.

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `handler` | `BigQueryCallbackHandler` | Yes | The BigQueryCallbackHandler instance. |
| `graph_name` | `str` | Yes | Name of the graph being executed. |
| `metadata` | `Optional[Dict[str, Any]]` | No | Optional metadata to include in events. (default: `None`) |

## Constructors

```python
__init__(
    self,
    handler: BigQueryCallbackHandler,
    graph_name: str,
    metadata: Optional[Dict[str, Any]] = None,
) -> None
```

| Name | Type |
|------|------|
| `handler` | `BigQueryCallbackHandler` |
| `graph_name` | `str` |
| `metadata` | `Optional[Dict[str, Any]]` |


## Properties

- `handler`
- `graph_name`
- `metadata`
- `run_id`

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/515c1ee9ffe9a0c9533d03a9def7f74f8c3455e4/libs/community/langchain_google_community/callbacks/bigquery_callback.py#L4425)