arazzo: 1.0.1 info: title: Ramp Locate Department Spend summary: Pull departments, users, and transactions to roll spend up by department. description: >- Builds the datasets needed to roll transaction spend up to a department. The workflow lists departments, then lists users so each user's department_id can be joined to a department, and finally lists transactions for a date window so each transaction's user_id can be traced through the user to its department. The three lists together let a caller compute per-department spend for the period. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: rampApi url: ../openapi/ramp-developer-api-openapi.yml type: openapi workflows: - workflowId: locate-department-spend summary: List departments, users, and transactions to attribute spend by department. description: >- Lists departments and users to build the user-to-department map, then lists transactions so spend can be rolled up by department. inputs: type: object required: - fromDate - toDate properties: accessToken: type: string description: OAuth2 client-credentials bearer token with departments:read, users:read, and transactions:read scopes. fromDate: type: string format: date description: Inclusive lower bound for the transaction window (YYYY-MM-DD). toDate: type: string format: date description: Inclusive upper bound for the transaction window (YYYY-MM-DD). steps: - stepId: listDepartments description: >- List the organization's departments to form the top level of the spend rollup. operationId: listDepartments parameters: - name: Authorization in: header value: Bearer $inputs.accessToken successCriteria: - condition: $statusCode == 200 outputs: departments: $response.body#/data - stepId: listUsers description: >- List users so each user's department_id can be joined to a department. operationId: listUsers parameters: - name: Authorization in: header value: Bearer $inputs.accessToken successCriteria: - condition: $statusCode == 200 outputs: users: $response.body#/data - stepId: listTransactions description: >- List transactions for the date window so each transaction's user_id can be traced to a department for the spend rollup. operationId: listTransactions parameters: - name: Authorization in: header value: Bearer $inputs.accessToken - name: from_date in: query value: $inputs.fromDate - name: to_date in: query value: $inputs.toDate successCriteria: - condition: $statusCode == 200 outputs: transactions: $response.body#/data outputs: departments: $steps.listDepartments.outputs.departments users: $steps.listUsers.outputs.users transactions: $steps.listTransactions.outputs.transactions