agents.agent-config.draft-from-description
Draft a complete agent config (name, system prompt, model, memory) from a human-typed job description. Wraps ai.chat.complete with an internal system prompt that never leaves the server.
Draft a complete agent config from a human-typed job description.
Wraps ai.chat.complete with an internal system prompt that never leaves the server. Produces a draft for human review — does NOT persist any rows. Phase 5a of the storage-workflows initiative; Phase 5b updates the staff app (ltinteg-app-staff/HireActorPage) to call this workflow instead of ai.chat.complete directly.
Overview
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-agents |
| Version | 1.0 |
Triggers
| Source | Endpoint / Event | Description |
|---|---|---|
| API | POST /api/agents/configs/draft | Draft an agent config from a human-typed job description |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | string | Yes | — | — |
description | string | Yes | — | — |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No | — | — |
description | string | No | — | — |
system_prompt | string | No | — | — |
model_name | string | No | — | — |
memory_enabled | boolean | No | — | — |
memory_strategy | string | No | — | — |
memory_top_k | integer | No | — | — |
notes | string | No | — | — |
failure_reason | string | No | — | — |
failed_at | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | integer | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
organization_uuid | json | 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 |
|---|---|---|---|
drafted | SUCCESS | Agent configuration draft generated from description | name, description, system_prompt, organization_uuid |
failed | FAILURE | Agent configuration draft generated from description failed | failure_reason, error, error_type, failed_at_state, failed_step, failed_layer |
Business Errors
| Code | Message Template |
|---|---|
AGENTS_ORGANIZATION_CONTEXT_INVALID | Authenticated organization context is missing or does not match the workflow input |
AGENTS_CONFIG_NOT_FOUND | Agent configuration {agent_config_uuid} was not found in the organization |
AGENTS_SKILL_NOT_FOUND | Agent skill {skill_uuid} was not found in the organization |
AGENTS_MCP_SERVER_NOT_FOUND | MCP server {mcp_server_uuid} was not found in the organization |
AGENTS_RUNNER_GROUP_NOT_FOUND | Runner group {runner_group_uuid} was not found in the organization |
AGENTS_VALIDATION_FAILED | Workflow input or domain state failed validation: |
AGENTS_CONFLICT | Conflicting agent domain state: |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "agents.agent-config.draft-from-description",
"initial_data": {
"organization_uuid": "value",
"description": "value"
}
}