Automation tools and scripts designed to simplify daily operations, task scheduling, and workflow management.
Taskflow-Automation is a Python-based toolkit for automating repetitive communication and operational tasks. Currently, the project includes a WhatsApp Business API message sender (Chat.py) that supports both single and bulk messaging via the Meta WhatsApp Business API.
- Single Message Sending — Send a WhatsApp message to one recipient instantly.
- Bulk Message Sending — Broadcast messages to multiple contacts with configurable delays to respect API rate limits.
- Interactive CLI — A simple command-line menu to send messages without writing any extra code.
- Programmatic API — Use the functions directly in your own Python scripts.
- Error Handling — Graceful handling of network errors with per-contact failure reporting and a summary at the end.
- Python 3.7+
requestslibrary
Install the dependency:
pip install requests- Go to https://developers.facebook.com/ and create an app.
- Add the WhatsApp product to your app.
- From the API setup page, obtain your:
ACCESS_TOKENPHONE_NUMBER_ID
- Open
Chat.pyand fill in your credentials at the top of the file:
ACCESS_TOKEN = "YOUR_WHATSAPP_ACCESS_TOKEN"
PHONE_NUMBER_ID = "YOUR_PHONE_NUMBER_ID"Note: In sandbox mode, recipient numbers must be verified in the Meta Developer Console before they can receive messages.
Run the script and follow the on-screen prompts:
python Chat.pyYou will see a menu:
=============================================
WhatsApp Business API - Message Sender
=============================================
1. Send Single Message
2. Send Bulk Messages
3. Exit
---------------------------------------------
You can also call the functions directly in your own code:
from Chat import send_single, send_bulk
# Send to a single recipient
send_single(
to="919876543210",
message="Hello! This is a test message."
)
# Send to multiple recipients
numbers = ["919876543210", "918765432109", "917654321098"]
send_bulk(
contacts=numbers,
message="Hello! This is a bulk message.",
delay_seconds=1.5
)To switch from interactive to programmatic mode, edit the bottom of Chat.py:
if __name__ == "__main__":
# interactive_mode() # comment this out
example_usage() # uncomment thisTaskflow-Automation/
└── Chat.py # WhatsApp Business API sender (single & bulk messaging)
📦 Starting bulk send to 3 contact(s)...
----------------------------------------
[1/3] Sending to 919876543210...
✅ Sent to 919876543210 | Message ID: wamid.xxx
[2/3] Sending to 918765432109...
✅ Sent to 918765432109 | Message ID: wamid.yyy
[3/3] Sending to 917654321098...
❌ Failed to send to 917654321098 | Error: ...
========================================
📊 Bulk Send Summary
Total : 3
✅ Success: 2
❌ Failed : 1
========================================
- Never commit your
ACCESS_TOKENto version control. Use environment variables or a.envfile instead. - Consider using
python-dotenvto load secrets safely:
from dotenv import load_dotenv
import os
load_dotenv()
ACCESS_TOKEN = os.getenv("WHATSAPP_ACCESS_TOKEN")
PHONE_NUMBER_ID = os.getenv("PHONE_NUMBER_ID")Contributions are welcome! Feel free to open an issue or submit a pull request to add new automation scripts or improve existing ones.
This project is open source. See the repository for license details.