# AutomationService

> The AutomationService methods and their request and response messages.

Source: https://engramsfactory.com/docs/api/automation/

Generated from [`automation.proto`](https://github.com/cortexapps/engrams/blob/main/crates/engram-protocol/proto/engram/app/v1/automation.proto). Every method is
`POST /rpc/engram.app.v1.AutomationService/<Method>` with a JSON or protobuf body and an
`x-api-key` header.

## Methods

| Method | Request | Response |
|---|---|---|
| `ListAutomations` | [`ListAutomationsRequest`](#listautomationsrequest) | [`ListAutomationsResponse`](#listautomationsresponse) |
| `GetAutomation` | [`GetAutomationRequest`](#getautomationrequest) | [`GetAutomationResponse`](#getautomationresponse) |
| `CreateAutomation` | [`CreateAutomationRequest`](#createautomationrequest) | [`CreateAutomationResponse`](#createautomationresponse) |
| `DraftAutomation` | [`DraftAutomationRequest`](#draftautomationrequest) | [`DraftAutomationResponse`](#draftautomationresponse) |
| `SaveVersion` | [`SaveVersionRequest`](#saveversionrequest) | [`SaveVersionResponse`](#saveversionresponse) |
| `ListVersions` | [`ListVersionsRequest`](#listversionsrequest) | [`ListVersionsResponse`](#listversionsresponse) |
| `SetAutomationEnabled` | [`SetAutomationEnabledRequest`](#setautomationenabledrequest) | [`SetAutomationEnabledResponse`](#setautomationenabledresponse) |
| `UpdateAutomationMeta` | [`UpdateAutomationMetaRequest`](#updateautomationmetarequest) | [`UpdateAutomationMetaResponse`](#updateautomationmetaresponse) |
| `SetInputs` | [`SetInputsRequest`](#setinputsrequest) | [`SetInputsResponse`](#setinputsresponse) |
| `SetMapInputEntry` | [`SetMapInputEntryRequest`](#setmapinputentryrequest) | [`SetMapInputEntryResponse`](#setmapinputentryresponse) |
| `SetInputValue` | [`SetInputValueRequest`](#setinputvaluerequest) | [`SetInputValueResponse`](#setinputvalueresponse) |
| `SetBlockOverrides` | [`SetBlockOverridesRequest`](#setblockoverridesrequest) | [`SetBlockOverridesResponse`](#setblockoverridesresponse) |
| `DuplicateAutomation` | [`DuplicateAutomationRequest`](#duplicateautomationrequest) | [`DuplicateAutomationResponse`](#duplicateautomationresponse) |
| `ArchiveAutomation` | [`ArchiveAutomationRequest`](#archiveautomationrequest) | [`ArchiveAutomationResponse`](#archiveautomationresponse) |
| `TestRender` | [`TestRenderRequest`](#testrenderrequest) | [`TestRenderResponse`](#testrenderresponse) |
| `DryRun` | [`DryRunRequest`](#dryrunrequest) | [`DryRunResponse`](#dryrunresponse) |
| `EvalCode` | [`EvalCodeRequest`](#evalcoderequest) | [`EvalCodeResponse`](#evalcoderesponse) |
| `RunNow` | [`RunNowRequest`](#runnowrequest) | [`RunNowResponse`](#runnowresponse) |
| `ListEventSamples` | [`ListEventSamplesRequest`](#listeventsamplesrequest) | [`ListEventSamplesResponse`](#listeventsamplesresponse) |
| `ListInputKeyOptions` | [`ListInputKeyOptionsRequest`](#listinputkeyoptionsrequest) | [`ListInputKeyOptionsResponse`](#listinputkeyoptionsresponse) |
| `DescribeInputKeys` | [`DescribeInputKeysRequest`](#describeinputkeysrequest) | [`DescribeInputKeysResponse`](#describeinputkeysresponse) |
| `ListEventCatalog` | [`ListEventCatalogRequest`](#listeventcatalogrequest) | [`ListEventCatalogResponse`](#listeventcatalogresponse) |
| `ListActionCatalog` | [`ListActionCatalogRequest`](#listactioncatalogrequest) | [`ListActionCatalogResponse`](#listactioncatalogresponse) |

## Messages

### ActionCatalogEntry

| Field | Type |
|---|---|
| `id` | `string` |
| `label` | `string` |
| `description` | `string` |
| `input_schema_json` | `string` |

### ArchiveAutomationRequest

| Field | Type |
|---|---|
| `id` | `string` |

### ArchiveAutomationResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### Automation

| Field | Type |
|---|---|
| `id` | `string` |
| `name` | `string` |
| `description` | `string` |
| `kind` | `string` |
| `builtin_key` | `string` (optional) |
| `enabled` | `bool` |
| `current_version` | `int32` |
| `inputs_json` | `string` |
| `block_overrides_json` | `string` |
| `archived` | `bool` |
| `created_by_user_id` | `string` (optional) |
| `next_fire_at` | `string` (optional) |
| `last_fired_at` | `string` (optional) |
| `draft_session_id` | `string` (optional) |
| `created_at` | `string` |
| `updated_at` | `string` |
| `version` | [`AutomationVersion`](#automationversion) |

### AutomationRunBrief

| Field | Type |
|---|---|
| `id` | `string` |
| `automation_id` | `string` |
| `version` | `int32` |
| `status` | `string` |
| `error` | `string` (optional) |
| `trigger_source` | `string` |
| `event_key` | `string` (optional) |
| `delivery_key` | `string` (optional) |
| `dry_run` | `bool` |
| `started_at` | `string` (optional) |
| `ended_at` | `string` (optional) |
| `created_at` | `string` |
| `instance_id` | `string` |
| `entrypoint_id` | `string` |

### AutomationSummary

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |
| `trigger_summary` | `string` |
| `last_run` | [`AutomationRunBrief`](#automationrunbrief) (optional) |
| `runs_7d` | repeated [`DayRunCount`](#dayruncount) |

### AutomationVersion

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `number` | `int32` |
| `definition_json` | `string` |
| `created_by_user_id` | `string` (optional) |
| `created_at` | `string` |

### BlockError

| Field | Type |
|---|---|
| `block_id` | `string` |
| `field` | `string` |
| `code` | `string` |
| `message` | `string` |

### BlockRender

| Field | Type |
|---|---|
| `block_id` | `string` |
| `block_type` | `string` |
| `rendered_json` | `string` |
| `filter_pass` | `bool` (optional) |
| `scope_json` | `string` |

### CreateAutomationRequest

| Field | Type |
|---|---|
| `name` | `string` |
| `description` | `string` |
| `enabled` | `bool` |
| `definition_json` | `string` |
| `inputs_json` | `string` |

### CreateAutomationResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### DayRunCount

| Field | Type |
|---|---|
| `day` | `string` |
| `completed` | `int32` |
| `failed` | `int32` |
| `filtered` | `int32` |
| `other` | `int32` |

### DescribeInputKeysRequest

| Field | Type |
|---|---|
| `noun` | `string` |
| `keys` | repeated `string` |
| `connection_id` | `string` (optional) |

### DescribeInputKeysResponse

| Field | Type |
|---|---|
| `options` | repeated [`InputKeyOption`](#inputkeyoption) |

### DraftAutomationRequest

| Field | Type |
|---|---|
| `prompt` | `string` |
| `profile_id` | `string` |
| `idempotency_key` | `string` |
| `harness` | `string` (optional) |
| `model` | `string` (optional) |
| `model_router` | `string` (optional) |
| `effort` | `string` (optional) |
| `harness_mode` | `string` (optional) |

### DraftAutomationResponse

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `session_id` | `string` |
| `created` | `bool` |

### DryRunRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `sample_id` | `string` (one of sample) |
| `payload_json` | `string` (one of sample) |
| `entrypoint_id` | `string` (optional) |

### DryRunResponse

| Field | Type |
|---|---|
| `run_id` | `string` |

### DuplicateAutomationRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `name` | `string` (optional) |

### DuplicateAutomationResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### EvalCodeRequest

| Field | Type |
|---|---|
| `source` | `string` |
| `mode` | `string` |
| `input_json` | `string` |

### EvalCodeResponse

| Field | Type |
|---|---|
| `value_json` | `string` (optional) |
| `error_name` | `string` (optional) |
| `error_message` | `string` (optional) |
| `error_line` | `int32` (optional) |
| `logs` | repeated `string` |
| `duration_ms` | `int64` |

### EventCatalogEntry

| Field | Type |
|---|---|
| `key` | `string` |
| `label` | `string` |
| `description` | `string` |
| `schema_json` | `string` |
| `sample_json` | `string` |
| `observed` | `bool` |
| `hidden` | `bool` |

### EventCatalogScope

| Field | Type |
|---|---|
| `key` | `string` |
| `label` | `string` |

### EventSample

| Field | Type |
|---|---|
| `id` | `string` |
| `event_key` | `string` |
| `payload_json` | `string` |
| `received_at` | `string` |

### GetAutomationRequest

| Field | Type |
|---|---|
| `id` | `string` (one of lookup) |
| `builtin_key` | `string` (one of lookup) |

### GetAutomationResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### InputKeyOption

| Field | Type |
|---|---|
| `key` | `string` |
| `label` | `string` |

### ListActionCatalogRequest

| Field | Type |
|---|---|
| `provider` | `string` |

### ListActionCatalogResponse

| Field | Type |
|---|---|
| `actions` | repeated [`ActionCatalogEntry`](#actioncatalogentry) |

### ListAutomationsRequest

| Field | Type |
|---|---|
| `include_archived` | `bool` |

### ListAutomationsResponse

| Field | Type |
|---|---|
| `automations` | repeated [`AutomationSummary`](#automationsummary) |

### ListEventCatalogRequest

| Field | Type |
|---|---|
| `provider` | `string` |

### ListEventCatalogResponse

| Field | Type |
|---|---|
| `events` | repeated [`EventCatalogEntry`](#eventcatalogentry) |
| `scope` | [`EventCatalogScope`](#eventcatalogscope) (optional) |
| `variables` | repeated [`WebhookVariable`](#webhookvariable) |
| `default_connection_id` | `string` |

### ListEventSamplesRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `event_key` | `string` (optional) |
| `limit` | `int32` |

### ListEventSamplesResponse

| Field | Type |
|---|---|
| `samples` | repeated [`EventSample`](#eventsample) |

### ListInputKeyOptionsRequest

| Field | Type |
|---|---|
| `noun` | `string` |
| `connection_id` | `string` (optional) |

### ListInputKeyOptionsResponse

| Field | Type |
|---|---|
| `options` | repeated [`InputKeyOption`](#inputkeyoption) |

### ListVersionsRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |

### ListVersionsResponse

| Field | Type |
|---|---|
| `versions` | repeated [`AutomationVersion`](#automationversion) |

### RunNowRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `inputs_json` | `string` (optional) |
| `payload_json` | `string` (optional) |
| `entrypoint_id` | `string` (optional) |
| `instance_key` | `string` (optional) |
| `instance_inputs_json` | `string` (optional) |

### RunNowResponse

| Field | Type |
|---|---|
| `run_id` | `string` |

### SaveVersionRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `definition_json` | `string` |

### SaveVersionResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### SetAutomationEnabledRequest

| Field | Type |
|---|---|
| `id` | `string` |
| `enabled` | `bool` |

### SetAutomationEnabledResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### SetBlockOverridesRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `overrides_json` | `string` |

### SetBlockOverridesResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### SetInputsRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `inputs_json` | `string` |

### SetInputsResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### SetInputValueRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `input_key` | `string` |
| `value_json` | `string` |

### SetInputValueResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### SetMapInputEntryRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `input_key` | `string` |
| `entry_key` | `string` |
| `value_json` | `string` (optional) |
| `enable` | `bool` |

### SetMapInputEntryResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### TestRenderRequest

| Field | Type |
|---|---|
| `automation_id` | `string` |
| `draft_definition_json` | `string` (optional) |
| `inputs_json` | `string` (optional) |
| `sample_id` | `string` (one of sample) |
| `payload_json` | `string` (one of sample) |
| `scheduled_for` | `string` (optional) |
| `entrypoint_id` | `string` (optional) |

### TestRenderResponse

| Field | Type |
|---|---|
| `blocks` | repeated [`BlockRender`](#blockrender) |
| `errors` | repeated [`BlockError`](#blockerror) |

### UpdateAutomationMetaRequest

| Field | Type |
|---|---|
| `id` | `string` |
| `name` | `string` (optional) |
| `description` | `string` (optional) |
| `settings_json` | `string` (optional) |

### UpdateAutomationMetaResponse

| Field | Type |
|---|---|
| `automation` | [`Automation`](#automation) |

### WebhookVariable

| Field | Type |
|---|---|
| `path` | `string` |
| `alias` | `string` |
