Workflow Overview
A 4-node linear pipeline that runs automatically when a business card photo is shared in Slack:
Fetch Image → Analyse Image → Extract Details → Add to CRM
Node Breakdown
1. Fetch Image
- Type: Slack Trigger
- Event:
file_share in the #connections channel
- Behaviour: Listens for new file uploads and downloads the attached image automatically
2. Analyse Image
- Type: Google Gemini (LangChain)
- Model:
gemini-3-flash-preview
- Input: Binary image from the Slack trigger
- Behaviour: Sends the image to Gemini with a structured prompt requesting a flat JSON object with the following fields:
full_name · job_title · company · email · phone · website · address · linkedin · twitter · other_social · notes
- Prompt rules:
- Every field must be present (null if not on card)
- If multiple phone numbers exist, the main one goes in
phone, the rest in notes
- Any extra card text goes in
notes
- Output must be raw JSON only - no markdown, no code fences
3. Extract Details
- Type: Code (JavaScript)
- Behaviour: Parses the Gemini response text into a usable JSON object:
- Strips any markdown code fences that Gemini may still include
- Converts all
null values to empty strings (prevents errors in downstream Notion writes)
- Returns a clean flat object ready for property mapping
4. Add to CRM
- Type: Notion (Create Database Page)