Skip to content

kunal-yelgate/Taskflow-Automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Taskflow-Automation

Automation tools and scripts designed to simplify daily operations, task scheduling, and workflow management.


📌 Overview

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.


🚀 Features

  • 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.

🛠️ Requirements

  • Python 3.7+
  • requests library

Install the dependency:

pip install requests

⚙️ Setup

  1. Go to https://developers.facebook.com/ and create an app.
  2. Add the WhatsApp product to your app.
  3. From the API setup page, obtain your:
    • ACCESS_TOKEN
    • PHONE_NUMBER_ID
  4. Open Chat.py and 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.


💻 Usage

Interactive Mode (CLI)

Run the script and follow the on-screen prompts:

python Chat.py

You will see a menu:

=============================================
 WhatsApp Business API - Message Sender
=============================================
 1. Send Single Message
 2. Send Bulk Messages
 3. Exit
---------------------------------------------

Programmatic Mode

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 this

📂 Project Structure

Taskflow-Automation/
└── Chat.py      # WhatsApp Business API sender (single & bulk messaging)

📊 Bulk Send Output Example

📦 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
========================================

🔒 Security

  • Never commit your ACCESS_TOKEN to version control. Use environment variables or a .env file instead.
  • Consider using python-dotenv to 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")

🤝 Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request to add new automation scripts or improve existing ones.


📄 License

This project is open source. See the repository for license details.

About

Automation tools and scripts designed to simplify daily operations, task scheduling, and workflow management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages