arazzo: 1.0.1 info: title: Factorial Upload Employee Document summary: Confirm an employee, upload a document for them, and confirm it appears in their documents. description: >- Attaches a document to an employee's Factorial profile. The workflow first confirms the employee exists, uploads the file via a multipart request, and then lists documents to confirm the upload landed. This is the building block for any contract, payslip, or HR document integration. 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: factorialApi url: ../openapi/factorial-openapi.yml type: openapi workflows: - workflowId: upload-employee-document summary: Upload a document for an employee and confirm it. description: >- Confirms the employee, uploads the document, and lists documents to verify. inputs: type: object required: - employee_id - file properties: employee_id: type: integer description: The id of the employee the document belongs to. file: type: string description: The document file contents to upload. folder_id: type: integer description: The optional folder id to place the document in. steps: - stepId: confirmEmployee description: >- Confirm the target employee exists before uploading a document. operationId: getEmployee parameters: - name: id in: path value: $inputs.employee_id successCriteria: - condition: $statusCode == 200 outputs: employeeId: $response.body#/id - stepId: uploadDocument description: >- Upload the document and attach it to the employee. operationId: uploadDocument requestBody: contentType: multipart/form-data payload: file: $inputs.file employee_id: $steps.confirmEmployee.outputs.employeeId folder_id: $inputs.folder_id successCriteria: - condition: $statusCode == 201 outputs: employeeId: $steps.confirmEmployee.outputs.employeeId - stepId: confirmDocuments description: >- List documents to confirm the upload landed. operationId: listDocuments successCriteria: - condition: $statusCode == 200 outputs: documents: $response.body#/data outputs: employeeId: $steps.uploadDocument.outputs.employeeId documents: $steps.confirmDocuments.outputs.documents