Get workflow by ID

GET/workflows/{id}

Retrieves a workflow definition by its ID

RequiresBearerauthentication

Path parameters

idstring (uuid)required

ID of the workflow to retrieve

Query parameters

verbosebooleanoptionaldefault false

If true, includes full workflow implementation details in workflow_details field

Returns  

Successfully retrieved workflow

Response fields

successbooleanoptional
workflowobjectoptional

Simplified workflow representation without implementation details

idstring (uuid)optional

Unique identifier for the workflow

namestringoptional

Human-readable name for the workflow

workflow_instructionsstringoptional

Natural language instructions that define the workflow logic

sample_dataobjectoptional

Sample data used for workflow graph generation

configobjectoptional
fhir_provider_idsstring (uuid)[]optional

FHIR provider IDs for executing workflow steps

dynamic_generationbooleanoptional

Whether to use dynamic lang2fhir generation instead of pre-populated templates

graphobjectoptional
stepsobject[]optional

Simplified list of workflow steps without operation details

created_atstring (date-time)optional

Timestamp when the workflow was created

updated_atstring (date-time)optional

Timestamp when the workflow was last updated

workflow_detailsobjectoptional

Only included when verbose=true - contains full implementation details

idstring (uuid)optional

Unique identifier for the workflow

namestringoptional

Human-readable name for the workflow

workflow_instructionsstringoptional

Natural language instructions that define the workflow logic

sample_dataobjectoptional

Sample data used for workflow graph generation

configobjectoptional
fhir_provider_idsstring (uuid)[]optional

FHIR provider IDs for executing workflow steps

dynamic_generationbooleanoptional

Whether to use dynamic lang2fhir generation instead of pre-populated templates

graphobjectoptional
stepsobject[]optional

Ordered list of workflow execution steps

created_atstring (date-time)optional

Timestamp when the workflow was created

updated_atstring (date-time)optional

Timestamp when the workflow was last updated

GETRequest
curl 'https://experiment.app.pheno.ml/workflows/550e8400-e29b-41d4-a716-446655440000?verbose=true' \
  -H 'Authorization: Bearer YOUR_API_KEY'
200 OKResponse
{
  "success": true,
  "workflow": {
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "name": "Patient Data Mapping Workflow",
    "workflow_instructions": "Given diagnosis data, find the patient and create condition record",
    "sample_data": {
      "diagnosis_code": "I10",
      "diagnosis_date": "2025-01-01",
      "patient_first_name": "Clay",
      "patient_last_name": "Rippin"
    },
    "config": {
      "fhir_provider_ids": [
        "550e8400-e29b-41d4-a716-446655440000"
      ],
      "dynamic_generation": false
    },
    "graph": {
      "steps": [
        {
          "id": "step_1_id",
          "name": "Find Patient",
          "description": "Search for an existing patient by first name and last name",
          "type": "search",
          "provider_id": "550e8400-e29b-41d4-a716-446655440000"
        }
      ]
    },
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T15:45:00Z"
  },
  "workflow_details": {
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "name": "Patient Data Mapping Workflow",
    "workflow_instructions": "Given diagnosis data, find the patient and create condition record",
    "sample_data": {
      "diagnosis_code": "I10",
      "diagnosis_date": "2025-01-01",
      "patient_first_name": "Clay",
      "patient_last_name": "Rippin"
    },
    "config": {},
    "graph": {
      "steps": [
        {
          "id": "1",
          "name": "Create Patient Resource",
          "description": "Create a FHIR Patient resource from input data",
          "type": "create",
          "operation": {
            "search_definition": {
              "original_query": "find patient {{patient_first_name}} {{patient_last_name}} by first name and last name",
              "resource_type": "Patient",
              "search_parameters": {
                "family": "{{patient_last_name}}",
                "given": "{{patient_first_name}}"
              },
              "required_fields": [
                "id",
                "name",
                "identifier"
              ],
              "runtime_placeholders": {
                "{{patient_first_name}}": "input.patient_first_name",
                "{{patient_last_name}}": "input.patient_last_name"
              }
            },
            "create_definition": {
              "original_description": "create condition with diagnosis code {{diagnosis_code}} and diagnosis date 2025-01-01",
              "resource_type": "Condition",
              "resource_template": {
                "resourceType": "Condition",
                "code": {
                  "coding": [
                    {
                      "code": "{{diagnosis_code}}",
                      "system": "http://hl7.org/fhir/sid/icd-10"
                    }
                  ]
                },
                "subject": {
                  "reference": "Patient/{{step_1_id}}"
                }
              },
              "runtime_placeholders": {
                "{{diagnosis_code}}": "input.diagnosis_code",
                "{{diagnosis_date}}": "input.diagnosis_date"
              }
            },
            "workflow_definition": {
              "workflow_id": "550e8400-e29b-41d4-a716-446655440002",
              "input": {
                "patient_id": "{{step_1_id}}",
                "additional_context": "laboratory_results"
              },
              "runtime_placeholders": {
                "{{step_1_id}}": "step_1.result.id",
                "{{patient_data}}": "input.patient_data"
              }
            },
            "decision_definition": {
              "expression": "input.patient_age >= 18",
              "paths": {
                "true": "step_adult_workflow",
                "false": "step_pediatric_workflow",
                "default": "step_error_handler"
              },
              "runtime_placeholders": {
                "{{patient_age}}": "input.patient_age",
                "{{diagnosis_type}}": "step_2.result.diagnosis_category"
              }
            }
          },
          "provider_id": "550e8400-e29b-41d4-a716-446655440000",
          "dependencies": [],
          "dynamic_generation": false
        }
      ]
    },
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T15:45:00Z"
  }
}