Woo Order Automation
Automates WooCommerce order lifecycle with n8n.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/alexphex/woo-order-automation/archive/refs/heads/main.zipWooCommerce order lifecycle automation plugin that sends order data to n8n workflows.
⚠️ This plugin is currently under development.
The goal of this project is to create a lightweight integration layer between WooCommerce and external automation tools like n8n.
Overview
Woo Order Automation listens to WooCommerce order status changes and sends order data to an external webhook.
Current flow:
WooCommerce Order Status Change
↓
OrderStatusListener
↓
Build Order Payload
↓
Webhook Request
↓
n8n Workflow
↓
Save Result to Logs
Current Features
WooCommerce Order Lifecycle
The plugin listens to:
- processing
- completed
- cancelled
- refunded
using:
woocommerce_order_status_changed
## Webhook Integration
Order data is sent to n8n using WordPress HTTP API:
wp_remote_post()
Webhook URL can be configured from:
Woo Order Automation
└── Settings
## Duplicate Protection
The plugin prevents sending the same order status multiple times.
It uses order meta:
_n8n_sent_processing
_n8n_sent_completed
_n8n_sent_cancelled
_n8n_sent_refunded
Example:
If order #76 was already sent when status became processing,
the plugin will skip another request.
## Logging System
Every webhook attempt is stored in a custom database table:
wp_woo_order_automation_logs
Stored information:
Order ID
Order status
Result (success / failed)
Response message
Created date
Example:
Order ID: 76
Status: processing
Result: failed
Message: HTTP error: 404
## Admin Logs Page
Available in:
WordPress Admin
|
└── Woo Order Automation
|
└── Logs
The page displays webhook history.
## Plugin Structure
woo-order-automation
├── src
│ ├── Admin
│ │ └── SettingsPage.php
│ │
│ ├── Hooks
│ │ └── OrderStatusListener.php
│ │
│ ├── Repository
│ │ └── LogRepository.php
│ │
│ ├── Services
│ │ ├── OrderPayloadBuilder.php
│ │ └── WebhookService.php
│ │
│ └── Plugin.php
│
├── composer.json
├── composer.lock
└── woo-order-automation.php
## Requirements
WordPress
WooCommerce
PHP 8+
Composer
## Installation
1. Clone or upload the plugin:
wp-content/plugins/woo-order-automation
2. Install dependencies:
composer install
3. Activate plugin from WordPress admin.
## Development Status
Currently implemented:
✅ WooCommerce order status listener
✅ Order payload builder
✅ n8n webhook integration
✅ Duplicate protection
✅ Webhook response handling
✅ Database logging
✅ Admin logs page
Planned:
Retry failed webhook requests
Improved logs filtering
Pagination for logs
Better error handling
Additional WooCommerce events
## Notes
This project is being developed as a custom WooCommerce automation solution.
The focus is on:
clean plugin structure
simple responsibilities
integration with external automation workflows
avoiding unnecessary complexity