agents.ft-dataset.build ​
Build and upload a fine-tuning dataset from completed agent sessions
Build and upload a fine-tuning dataset from completed agent sessions.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Dag |
| Library | App-agents |
| Version | 1.0 |
Triggers ​
| Source | Endpoint / Event | Description |
|---|---|---|
| API | POST /api/agents/ft-datasets/{dataset_uuid}/build | Trigger a fine-tuning dataset build |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
workflow_run_uuid | string | No | — | DAG-stamped parent run id (auto-injected by the engine) |
dataset_uuid | string | Yes | — | — |
organization_uuid | string | Yes | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
error | string | No | — | — |
error_type | string | No | — | — |
failed_at | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | json | No | — | — |
failed_step | string | No | — | — |
failure_reason | string | No | — | — |
workflow_run_uuid | json | No | — | — |
dataset_uuid | json | No | — | — |
organization_uuid | json | No | — | — |
validate | json | No | — | — |
build-examples | json | No | — | — |
upload | json | No | — | — |
finalize | json | No | — | — |
mark-failed | json | No | — | — |
compensation_trigger | json | No | — | — |
comp_queue | json | No | — | — |
comp_current_layer | json | No | — | — |
comp_retry_count | json | No | — | — |
DAG Layers ​
| # | Layer | Steps | Compensation |
|---|---|---|---|
| 1 | validate | agents._ft-dataset.validate | — |
| 2 | build-examples | agents._ft-dataset.build-examples | agents._ft-dataset.mark-failed |
| 3 | upload | agents._ft-dataset.upload | agents._ft-dataset.mark-failed |
| 4 | finalize | agents._ft-dataset.finalize | agents._ft-dataset.mark-failed |
Execution Flow ​
Compensation ​
When any layer fails, its compensation steps run in reverse order to roll back the work completed so far.
Sub-workflows ​
| Sub-workflow | Step name |
|---|---|
agents._ft-dataset.validate | validate |
agents._ft-dataset.build-examples | build-examples |
agents._ft-dataset.upload | upload |
agents._ft-dataset.finalize | finalize |
agents._ft-dataset.mark-failed | mark-failed |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
built | SUCCESS | Fine-tuning dataset build completed | workflow_run_uuid, dataset_uuid, organization_uuid |
failed | FAILURE | Fine-tuning dataset build completed 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_DATASET_NOT_FOUND | Fine-tuning dataset {dataset_uuid} was not found in the organization |
AGENTS_VALIDATION_FAILED | Workflow input or domain state failed validation: |
AGENTS_CONFLICT | Conflicting agent domain state: |
AGENTS_PROVIDER_FAILED | Upstream provider or runner call failed: |
AGENTS_MCP_CALL_FAILED | MCP tool call failed for {tool_name}: |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "agents.ft-dataset.build",
"initial_data": {
"dataset_uuid": "value",
"organization_uuid": "value"
}
}