media.image.generate
Generate an image via the org AI connection (Azure-first), persist bytes to storage, return StorageObject UUID only. Prefer media_profile_uuid (fail-closed ready profile); explicit connection/storage/bucket/model kept for back-compat.
Overview
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-media |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
workflow_run_id | string | No | — | Parent DAG workflow run id (engine-injected when used as a step) |
organization_uuid | string | Yes | — | — |
media_profile_uuid | string | No | — | Preferred: ready MediaProfile UUID. Fills AI connection + model (from AIProviderConfig) and storage/bucket. Rejects disagreeing overrides. |
ai_provider_config_uuid | string | No | — | Filled from MediaProfile resolution (AIProviderConfig that owns default_model); echoed for provenance — not a caller override |
connection_uuid | string | No | — | Org AI CloudConnection UUID — required unless resolved from media_profile_uuid / org default ready profile (back-compat) |
storage_connection_uuid | string | No | — | Required unless resolved from MediaProfile (back-compat) |
bucket | string | No | — | Required unless resolved from MediaProfile (back-compat) |
prompt | string | Yes | — | — |
model | string | No | — | Deployment/model id — required unless resolved from AIProviderConfig via MediaProfile (back-compat) |
size | string | No | — | — |
quality | string | No | — | — |
key | string | No | — | — |
n | integer | No | — | — |
register_artifact | boolean | No | — | Default true — write GeneratedArtifact after put |
review_gate | string | No | — | — |
brand | string | No | — | — |
campaign | string | No | — | — |
purpose | string | No | — | — |
session_uuid | string | No | — | When set, also stamp agents.cost-entry-record unit=image |
produced_by_kind | string | No | — | — |
produced_by_uuid | string | No | — | — |
created_by_uuid | string | No | — | — |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
workflow_run_id | string | No | — | Parent DAG workflow run id (engine-injected when used as a step) |
organization_uuid | string | Yes | — | — |
media_profile_uuid | string | No | — | — |
ai_provider_config_uuid | string | No | — | — |
connection_uuid | string | No | — | Org AI CloudConnection UUID — required unless resolved from media_profile_uuid / org default ready profile (back-compat) |
storage_connection_uuid | string | No | — | Required unless resolved from MediaProfile (back-compat) |
bucket | string | No | — | Required unless resolved from MediaProfile (back-compat) |
prompt | string | Yes | — | — |
model | string | No | — | — |
size | string | No | — | — |
quality | string | No | — | — |
key | string | No | — | — |
n | integer | No | — | — |
register_artifact | boolean | No | — | Default true — write GeneratedArtifact after put |
review_gate | string | No | — | — |
brand | string | No | — | — |
campaign | string | No | — | — |
purpose | string | No | — | — |
session_uuid | string | No | — | When set, also stamp agents.cost-entry-record unit=image |
produced_by_kind | string | No | — | — |
produced_by_uuid | string | No | — | — |
created_by_uuid | string | No | — | — |
storage_object_uuid | string | No | — | — |
size_bytes | integer | No | — | — |
sha256 | string | No | — | — |
unit | string | No | — | — |
quantity | integer | No | — | — |
provider | string | No | — | — |
artifact_uuid | string | No | — | — |
verdict | string | No | — | — |
cost_usd | string | No | — | — |
failure_reason | string | No | — | Engine-stamped human-readable failure reason |
failed_at | string | No | — | ISO timestamp when the workflow failed |
failed_at_state | string | No | — | Engine-stamped state when the workflow failed |
failed_step | string | No | — | Engine-stamped step name (DAG path) |
failed_layer | integer | No | — | Engine-stamped layer index (DAG path) |
error | string | No | — | Engine-stamped exception message |
error_type | string | No | — | Engine-stamped exception class name |
completed_at | string | No | — | — |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
Outcomes
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
completed | SUCCESS | Media atom completed successfully | completed_at |
failed | FAILURE | Media atom failed | failure_reason, error, error_type |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "media.image.generate",
"initial_data": {
"organization_uuid": "value",
"prompt": "value"
}
}