Execute workflow

POST/workflows/{id}/execute
RequiresBearerauthentication

Path parameters

idstring (uuid)required

Body parameters

input_dataobjectrequired
previewbooleanoptionaldefault false
Returns  

Response fields

successbooleanoptional
messagestringoptional
resultsobjectoptional
stepsobjectoptional
previewbooleanoptional
POSTRequest
# 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 POST "https://experiment.app.pheno.ml/workflows/7a8b9c0d-1234-5678-abcd-ef9876543210/execute" \
  -H "Authorization: Bearer $PHENOML_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "input_data": {
    "patient_last_name": "Johnson",
    "patient_first_name": "Mary",
    "diagnosis_code": "M79.3",
    "encounter_date": "2024-03-20"
  }
}'
200 OKExample Response
{
  "success": true,
  "message": "Workflow executed successfully",
  "results": {
    "steps": {
      "step_1_id": {
        "type": "search_result",
        "original_query": "find patient by first name Mary and last name Johnson",
        "resource_type": "Patient",
        "search_params": {
          "family": "Johnson",
          "given": "Mary"
        },
        "results": [
          {
            "resourceType": "Patient",
            "id": "patient-123",
            "name": [
              {
                "family": "Johnson",
                "given": [
                  "Mary"
                ],
                "use": "usual"
              }
            ],
            "gender": "female",
            "birthDate": "1961-01-01"
          }
        ]
      },
      "step_2_id": {
        "type": "create_result",
        "id": "condition-456",
        "resource_type": "Condition",
        "original_desc": "create condition with diagnosis code M79.3 for the patient from step_1_id",
        "preview": false,
        "created_resource": {
          "resourceType": "Condition",
          "id": "condition-456",
          "clinicalStatus": {
            "coding": [
              {
                "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
                "code": "active"
              }
            ]
          },
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/sid/icd-10",
                "code": "M79.3",
                "display": "Panniculitis, unspecified"
              }
            ]
          },
          "subject": {
            "reference": "Patient/patient-123"
          }
        }
      }
    }
  },
  "preview": false
}