apiVersion: naftiko.dev/v1 kind: WorkflowCapability metadata: name: bulk-cohort-export provider: childrens-hospital-of-philadelphia description: Backend-services (client_credentials) workflow that triggers a Group-level $export at the CHOP FHIR endpoint, polls for completion, and downloads NDJSON files for population analytics. Requires CHOP-approved app registration with system/*.read scope. spec: trigger: type: oauth2-client-credentials tokenUrl: https://epicnsproxy.chop.edu/fhir/oauth2/token scopes: - system/*.read steps: - id: kickoff capability: chop.bulk.export params: groupId: _type: Patient,Condition,Observation,Encounter,Procedure,MedicationRequest,Immunization - id: poll-status type: poll description: Poll the Content-Location URL until status 200 (manifest) or terminal error. - id: download-ndjson type: fetch description: Stream each output[].url NDJSON file with the access token.