A serverless AWS infrastructure that allows you to submit long-running tasks (code generation, research, data processing) that execute asynchronously in the cloud, with email notifications upon completion.
- Work offline: Submit tasks before bed, get results by morning
- No laptop required: Tasks run in AWS Lambda even when your computer is off
- Cost-effective: Pay only for execution time (~$0.02 per task)
- Email notifications: Receive results with inline content and file attachments
- Simple CLI: Submit tasks with a single command
┌─────────────┐
│ CLI Tool │ ──HTTP──> API Gateway ──> Lambda: Dispatcher
└─────────────┘ │
↓
SQS Queue
│
↓
┌─────────> Lambda: Executor ────> Claude API
│ │
│ ↓
DynamoDB Table S3 Bucket
│ (Results)
↓
Lambda: Notifier ──> Amazon SES
│ (Email)
↓
Your Inbox 📧
- API Gateway: HTTPS endpoint for task submission
- Lambda Functions: Dispatcher, Executor, Notifier
- SQS Queue: Reliable task delivery with retries
- DynamoDB: Task state tracking
- S3: Results storage
- SES: Email notifications
- Submit tasks from your terminal
- Check task status
- List recent tasks
- Cancel running tasks
- AWS Account with CLI configured
- AWS SAM CLI installed
- Anthropic API key (Claude)
- Verified email address in Amazon SES
- Node.js 20.x or higher
cd infrastructure
# Store your Anthropic API key in AWS Secrets Manager
aws secretsmanager create-secret \
--name anthropic-api-key \
--secret-string "your-api-key-here" \
--region us-east-1
# Verify your email in SES for notifications
aws ses verify-email-identity \
--email-address [email protected] \
--region us-east-1
# Deploy the stack
sam build
sam deploy --guidedDuring the guided deployment, you'll be asked for:
- Stack name (e.g.,
async-tasks) - AWS Region (e.g.,
us-east-1) - Notification email address
- Anthropic API key secret name
cd cli
npm install -g .Create ~/.async-task-config.json:
{
"apiEndpoint": "https://YOUR-API-ID.execute-api.us-east-1.amazonaws.com/prod",
"tasksTable": "AsyncTasks",
"region": "us-east-1"
}(Replace YOUR-API-ID with the API endpoint from the SAM deployment outputs)
async-task submit --type code --prompt "Write a function to calculate Fibonacci numbers"You'll receive an email when the task completes!
# Code generation
async-task submit --type code --prompt "Build a REST API with Express"
# Research task
async-task submit --type research --prompt "Best practices for AWS Lambda optimization"async-task status <task-id>async-task listasync-task cancel <task-id>- code: Code generation and programming tasks
- research: Research, analysis, and information gathering
- pkb-maintenance: Personal knowledge base operations (custom)
- scheduled: Recurring automation tasks
When a task completes, you'll receive an email with:
- Inline results: Full output displayed in the email body
- File attachment: Downloadable file (
task-xxxxx-result.txt) - S3 link: Presigned URL (valid for 24 hours)
Based on 500 tasks/month:
| Service | Monthly Cost |
|---|---|
| AWS Lambda | $0.20 |
| DynamoDB | $0.50 |
| S3 | $0.50 |
| SQS | Free tier |
| SES | Free tier |
| API Gateway | Free tier |
| AWS Total | ~$1.20 |
| Claude API (500 tasks) | ~$7.50 |
| Grand Total | ~$8.70/month |
Edit infrastructure/template.yaml:
Parameters:
AnthropicApiKeySecretName:
Default: anthropic-api-key
NotificationEmail:
Default: [email protected]- Executor timeout: 900 seconds (15 minutes max)
- Executor memory: 512 MB
- SQS visibility timeout: 900 seconds
- S3 lifecycle: Results deleted after 30 days
- ✅ API key stored in AWS Secrets Manager
- ✅ S3 server-side encryption (AES-256)
- ✅ DynamoDB encryption at rest
- ✅ SQS encryption in transit
- ✅ IAM roles with least privilege
- ✅ No public access (authenticated CLI only)
Add credits at https://console.anthropic.com/settings/billing
- Check spam folder
- Verify email in SES:
aws ses get-identity-verification-attributes --identities [email protected] --region us-east-1 - Check Lambda logs:
aws logs tail /aws/lambda/AsyncTasks-Notifier --region us-east-1
Check executor Lambda logs:
aws logs tail /aws/lambda/AsyncTasks-Executor --region us-east-1 --follow.
├── infrastructure/ # AWS SAM template
│ ├── template.yaml # CloudFormation template
│ └── lambdas/
│ ├── dispatcher/ # Task validation & queueing
│ ├── executor/ # Task execution (Claude API)
│ └── notifier/ # Email notifications
└── cli/ # CLI tool
├── src/
│ ├── index.js
│ └── commands/
└── package.json
# Invoke Lambda locally
sam local invoke ExecutorFunction -e events/test-task.json
# Start local API
sam local start-apiContributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - See LICENSE file for details
Built with:
Note: This system requires active AWS and Anthropic accounts. Costs may vary based on usage.