Update workflow

PUT/workflows/{id}

Updates an existing workflow definition

RequiresBearerauthentication

Path parameters

idstring (uuid)required

ID of the workflow to update

Query parameters

verbosebooleanoptionaldefault false

If true, includes full workflow implementation details in workflow_details field

Body parameters

namestringrequired

Human-readable name for the workflow

workflow_instructionsstringrequired

Natural language instructions that define the workflow logic

sample_dataobjectrequired

Sample data to use for workflow graph generation

fhir_provider_idoneOfrequired

FHIR provider ID(s) - must be valid UUID(s) from existing FHIR providers

dynamic_generationbooleanoptional

Enable dynamic lang2fhir calls instead of pre-populated templates

Returns  

Successfully updated workflow

Response fields

successbooleanoptional
messagestringoptional
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

PUTRequest
# Get authentication token
PHENOML_TOKEN=$(curl -X POST "https://experiment.app.pheno.ml/v2/auth/token" \
  -u "$PHENOML_CLIENT_ID:$PHENOML_CLIENT_SECRET" \
  | jq -r '.access_token')

curl -X PUT "https://experiment.app.pheno.ml/workflows/{id}" \
  -H "Authorization: Bearer $PHENOML_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Patient Data Mapping Workflow (v2)",
  "workflow_instructions": "Given diagnosis data, find the patient and create a condition record linked to their encounter",
  "sample_data": {
    "patient_last_name": "Rippin",
    "patient_first_name": "Clay",
    "diagnosis_code": "I10",
    "encounter_date": "2024-01-15"
  },
  "fhir_provider_id": "550e8400-e29b-41d4-a716-446655440000"
}'
200 OKExample Response
{
  "success": true,
  "message": "Workflow updated successfully",
  "workflow": {
    "id": "7a8b9c0d-1234-5678-abcd-ef9876543210",
    "name": "Patient Data Mapping Workflow (v2)",
    "workflow_instructions": "Given diagnosis data, find the patient and create a condition record linked to their encounter",
    "sample_data": {
      "patient_last_name": "Rippin",
      "patient_first_name": "Clay",
      "diagnosis_code": "I10",
      "encounter_date": "2024-01-15"
    },
    "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-15T09:30:00Z",
    "updated_at": "2024-02-20T11:00:00Z"
  }
}