arazzo: 1.0.1 info: title: Hunter Combined Enrich and Upsert Lead summary: Combine person and company enrichment for an email, then upsert it as a lead. description: >- Turns a bare email address into a richly populated lead. The flow runs combined enrichment to pull both the person and the company behind an email, then upserts a lead populated with the enriched name, company, and employer details. Each step spells out its request inline, including the api_key query parameter, so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: hunterApi url: ../openapi/hunter-api-openapi.yml type: openapi workflows: - workflowId: combined-enrich-upsert-lead summary: Combined-enrich an email, then upsert an enriched lead. description: >- Pulls person and company data for an email via combined enrichment and upserts a lead populated with the discovered name and company. inputs: type: object required: - apiKey - email properties: apiKey: type: string description: Hunter API key passed as the api_key query parameter. email: type: string description: Email address to enrich and upsert as a lead. leadsListId: type: integer description: Optional leads list identifier to add the lead to. steps: - stepId: combinedEnrich description: >- Run combined enrichment to capture both the person's name and the company name behind the email address. operationId: combinedEnrichment parameters: - name: api_key in: query value: $inputs.apiKey - name: email in: query value: $inputs.email successCriteria: - condition: $statusCode == 200 outputs: givenName: $response.body#/data/person/name/givenName familyName: $response.body#/data/person/name/familyName companyName: $response.body#/data/company/name - stepId: upsertLeadStep description: >- Upsert a lead populated with the enriched name and company for the email, creating it when new or updating it when it already exists. operationId: upsertLead parameters: - name: api_key in: query value: $inputs.apiKey requestBody: contentType: application/json payload: email: $inputs.email first_name: $steps.combinedEnrich.outputs.givenName last_name: $steps.combinedEnrich.outputs.familyName company: $steps.combinedEnrich.outputs.companyName leads_list_id: $inputs.leadsListId successCriteria: - condition: $statusCode == 200 outputs: leadId: $response.body#/data/id leadEmail: $response.body#/data/email outputs: companyName: $steps.combinedEnrich.outputs.companyName leadId: $steps.upsertLeadStep.outputs.leadId