arazzo: 1.0.1 info: title: Auth0 Find User by Email and Add to an Organization summary: Resolve a user by email and, when found, add them as a member of an existing organization. description: >- A find-then-act membership flow. The workflow searches for a user by email and branches on the result: when a matching user is found it adds that user as a member of the supplied organization and confirms by listing members, and when no user matches it ends without making changes. Each 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: auth0ManagementApi url: ../openapi/auth0-management-api-openapi.yml type: openapi workflows: - workflowId: find-user-add-to-org summary: Resolve a user by email then add them to an organization when found. description: >- Searches users by email and, when a match is found, adds the user to the supplied organization and lists the members to verify. inputs: type: object required: - email - orgId properties: email: type: string description: Email address to look the user up by (case-sensitive). orgId: type: string description: Identifier of the existing organization to add the user to. steps: - stepId: findUser description: >- Search for a user by email address. operationId: get_users-by-email parameters: - name: email in: query value: $inputs.email successCriteria: - condition: $statusCode == 200 outputs: matchedUserId: $response.body#/0/user_id onSuccess: - name: userFound type: goto stepId: addMember criteria: - context: $response.body condition: $.length > 0 type: jsonpath - name: userMissing type: end criteria: - context: $response.body condition: $.length == 0 type: jsonpath - stepId: addMember description: >- Add the matched user as a member of the supplied organization. operationId: post_members parameters: - name: id in: path value: $inputs.orgId requestBody: contentType: application/json payload: members: - $steps.findUser.outputs.matchedUserId successCriteria: - condition: $statusCode == 204 - stepId: listMembers description: >- List the organization's members to confirm the user was added. operationId: get_organization_members parameters: - name: id in: path value: $inputs.orgId successCriteria: - condition: $statusCode == 200 outputs: members: $response.body outputs: matchedUserId: $steps.findUser.outputs.matchedUserId members: $steps.listMembers.outputs.members