Quick overview
This workflow receives visa eligibility requests via webhook, uses Anthropic Claude to extract passport details and assess visa requirements, generates a purpose-specific document checklist, converts it to a PDF via PDFShift, logs each request to Google Sheets, and emails the PDF to the applicant using SendGrid.
How it works
- Receives a webhook POST with applicant details, travel plan, and raw passport OCR text.
- Uses Anthropic Claude to extract and validate passport data (name, nationality, passport number, expiry) and scores whether the passport text is readable.
- If passport data is insufficient, immediately returns a webhook response asking the applicant to resubmit a clearer passport scan.
- If passport data is sufficient, waits briefly and uses Anthropic Claude again to determine whether a visa is required, the visa category, a recommended visa type, processing time, risks, and confidence.
- Builds a document checklist from a standard base list plus purpose-specific items and any AI-flagged eligibility risks, then renders it into HTML.
- Sends the HTML to PDFShift to generate a PDF, formats a summary row, and appends the application record to a Google Sheets tab.
- Emails the applicant the assessment with the checklist PDF attached via SendGrid and returns the full assessment as JSON in the webhook response.
Setup
- Add an Anthropic API credential (Claude Sonnet) and connect it to both AI steps for passport extraction and visa rules assessment.
- Configure an HTML-to-PDF provider by setting the PDFShift (or equivalent) API URL and replacing
YOUR_PDF_API_KEY in the PDF generation request.
- Configure SendGrid by replacing
YOUR_SENDGRID_API_KEY and updating the sender email/name and any email content as needed.
- Set up Google Sheets OAuth2 access and replace
YOUR_SHEET_ID, then create a VisaApplications sheet/tab with columns matching the appended summary row.
- Copy the webhook URL for
visa-eligibility-inbound and send test POST requests that include applicantName, applicantEmail, destinationCountry, travelPurpose, intendedArrivalDate, intendedStayDays, and passportOcrText.