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

# ProjectEvent

export const GCell = ({children, className}) => <div className={`grid-table-cell ${className || ""}`} role="cell">
    {children}
  </div>;

export const GTH = ({children, className}) => <div className={`grid-table-th ${className || ""}`} role="columnheader">
    {children}
  </div>;

export const GRow = ({children}) => <div className="grid-table-row" role="row">{children}</div>;

export const GBody = ({children}) => <div className="grid-table-body" role="rowgroup">{children}</div>;

export const GHead = ({children}) => <div className="grid-table-head" role="rowgroup">{children}</div>;

export const GTable = ({children, className, cols}) => <div className={`grid-table not-prose overflow-hidden rounded-2xl ${className || ""}`} style={{
  "--grid-table-cols": cols
}} role="table">
    {children}
  </div>;

The `ProjectEvent` type returned by event operations.

```python theme={null}
from obproject.project_events import ProjectEvent

ProjectEvent(name, project=None, branch=None).publish(payload=None)
ProjectEvent(name, project=None, branch=None).safe_publish(payload=None)
```

Publish events from **outside** a flow-notebooks, deployed apps, scripts. Inside a `@step`, prefer `prj.publish_event()` above.

<GTable cols="12% 10% 78%">
  <GHead>
    <GRow>
      <GTH>Parameter</GTH>
      <GTH>Type</GTH>
      <GTH>Description</GTH>
    </GRow>
  </GHead>

  <GBody>
    <GRow>
      <GCell>`name`</GCell>
      <GCell>str</GCell>
      <GCell>Event name (must match the `event=` in a `@project_trigger`)</GCell>
    </GRow>

    <GRow>
      <GCell>`project`</GCell>
      <GCell>str</GCell>
      <GCell>Project name. If `None`, reads `OB_PROJECT` env or `current.project_name`.</GCell>
    </GRow>

    <GRow>
      <GCell>`branch`</GCell>
      <GCell>str</GCell>
      <GCell>Branch name. If `None`, reads `OB_BRANCH` env or extracts from `current.branch_name`.</GCell>
    </GRow>

    <GRow>
      <GCell>`payload`</GCell>
      <GCell>dict</GCell>
      <GCell>JSON-serializable payload</GCell>
    </GRow>
  </GBody>
</GTable>

```python theme={null}
ProjectEvent("model_trained", project="my_prj", branch="main").safe_publish(
    payload={"accuracy": 0.95}
)
```

Events resolve to `prj.{project}.{branch}.{name}`, the same namespace consumed by `@project_trigger`. The equivalent low-level Metaflow call is `ArgoEvent("prj.my_prj.main.model_trained").safe_publish(payload=...)`.
