This bot streamlines the process of kicking off a new hire in Slack. It accepts an unstructured command from a manager or recruiter, extracts structured compensation and role details, confirms accuracy with the user, collects necessary information from the new hire via a form, creates their Deel profile, and logs the data into a Google Sheet.
-
Trigger Command:
A manager sends a message like:"/hire Let's hire @dan as a backend engineer for $130k, 0.3% equity, starting May 1st"
-
Bot Parses the Message:
The bot uses OpenAI to structure the following details:- Role: Backend Engineer
- Salary: $130,000
- Equity: 0.3%
- Start Date: May 1st
- Slack handle:
@username
-
Bot Responds in Thread:
Shows a formatted message with parsed details and confirmation button:Just to confirm, you're hiring: • Role: Backend Engineer • Salary: $130,000 • Equity: 0.3% • Start Date: May 1st • Slack: @dan[Confirm Hire] button included
-
After Confirmation: Bot sends a DM to the new hire with:
- Welcome message
- Role and start date confirmation
- Interactive form requesting:
- Full Legal Name
- Address
- Personal Email
- Phone Number
-
Form Submission:
- New hire fills out the form
- Bot validates the information
- Creates Deel profile with provided information
- Notifies hiring manager of completion
-
Data Logging:
- Logs hire details to Google Sheet
- Tracks Deel profile creation status
- Framework: Bolt for JavaScript (Node.js)
- Triggers:
/hirecommand in messages - Interactions:
- Confirmation button
- Interactive form for new hire
- DM communications
- Thread updates
- Service: OpenAI API
- Purpose: Extract structured hire data from free-text
- Fields: role, salary, equity, start date, Slack handle
- Error Handling: Request clarification if parsing fails
- API: Deel REST API
- Actions:
- Create candidate profile
- Set compensation details
- Track profile creation status
- Error Handling: Notify manager of any issues
- Purpose: Data logging and tracking
- Columns:
- Timestamp
- Hiring Manager
- Role
- Salary
- Equity
- Start Date
- Slack Handle
- Deel Profile Status
- New Hire Details (Name, Email, etc.)
app_mentions:readchat:writechat:write.publicim:writeusers:readchannels:history
- API Token with candidate creation permissions
- Service account with write access
/
├── .env # Environment variables
├── index.js # Main application & Bolt setup
├── slack.js # Message handlers & UI logic
├── deel.js # Deel API integration
├── sheets.js # Google Sheets logging
├── openai.js # Message parsing logic
└── package.json # Dependencies
-
Message Parsing
- Request clarification if OpenAI can't parse confidently
- Allow manual correction of parsed fields
-
Form Validation
- Validate all required fields
- Ensure email format is correct
- Verify phone number format
-
API Integration
- Handle Deel API errors gracefully
- Retry failed Google Sheets updates
- Log all errors for debugging
-
User Communication
- Clear error messages to users
- Status updates in threads
- Confirmation of successful actions