=== Flowmator ===
Contributors: wprigel
Tags: automation, workflow, trigger, action, woocommerce
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Visual workflow automation for WordPress. Connect triggers to actions with a drag-and-drop canvas builder — no code required.

== Description ==

Flowmator is a visual workflow automation plugin for WordPress. It lets you connect WordPress events (triggers) to automated responses (actions) using a drag-and-drop canvas builder.

Think of it as "If This Then That" for your WordPress site — but with a proper visual workflow builder, execution history, analytics, and AI-powered automation built in.

WordPress sites generate dozens of events every day: users register, posts get published, comments get submitted, orders are placed. Responding to these events manually is repetitive, error-prone, and does not scale. Flowmator automates all of this reliably. You build a workflow once, and it runs automatically every time the triggering event fires.

= Core Features =

* **16 built-in triggers** — User, Post, Comment, Media, and WooCommerce events
* **21 built-in actions** — Email, User management, Post management, Comment management, HTTP requests, and AI
* **Visual workflow builder** — ReactFlow canvas with drag-and-drop nodes
* **Conditional branching** — Route workflows based on data conditions (user role, post category, order total, and more)
* **Delay scheduling** — Postpone actions by minutes, hours, or days using Action Scheduler
* **Merge tags** — Inject live data from the triggering event into any action field
* **Run-once enforcement** — Prevent duplicate executions per entity
* **Execution logging** — Full audit trail with per-step status
* **Analytics and reports** — Daily stats, charts, and CSV export
* **Workflow simulator** — Test workflows without side effects
* **Template library** — 20 ready-to-use workflow templates
* **AI actions** — Generate text, moderate content, and auto-tag posts using GPT-4o, Gemini, and Groq models
* **WooCommerce integration** — Order triggers and coupon/status actions bundled in the free plugin
* **Import / Export** — Share workflows between sites as JSON files

= All 16 Triggers =

**User:** User Registered, User Profile Updated, User Login, User Logout, User Role Changed, User Deleted, Password Reset

**Post:** Post Published, Post Updated, Post Deleted, Post Status Changed

**Comment:** Comment Submitted, Comment Approved

**Media:** Media Uploaded

**WooCommerce:** WooCommerce Order Created, WooCommerce Order Completed

= All 21 Actions =

**Email:** Send Email

**User:** Create User, Update User Meta, Change User Role, Send Password Reset

**Post:** Create Post, Update Post, Update Post Field, Change Post Status, Add Post Meta, Delete Post

**Comment:** Add Comment, Update Comment Status, Add Comment Label, Add Comment Meta

**Integration:** HTTP Request (GET, POST, PUT, PATCH, DELETE — with JSON response parsing)

**AI:** AI Generate Text, AI Content Moderation, AI Auto-Tag

**WooCommerce:** Create WooCommerce Coupon, Update Order Status

= AI Actions =

Three AI actions are included in the free plugin. They require an API key from at least one supported provider:

* **OpenAI** — GPT-4o Mini, GPT-4o
* **Google Gemini** — Gemini 2.0 Flash, Gemini 2.5 Flash, Gemini 2.5 Pro
* **Groq** — Llama 3.3 70B, Llama 3.1 8B, Mixtral 8x7B

Use AI Generate Text to write personalized emails, summarize post content, or draft social copy. Use AI Content Moderation to automatically filter spam and toxic comments. Use AI Auto-Tag to apply relevant tags and categories to new posts.

= Template Library =

20 pre-built templates are included across seven categories: User onboarding, Post notifications, Comment moderation, AI automation, WooCommerce sequences, scheduled digests, and a blank canvas starter.

= WooCommerce Integration =

WooCommerce triggers and actions are bundled in the free plugin at no extra cost. Automate order confirmations, generate personalized coupons on first purchase, send post-purchase follow-up sequences, and update order statuses automatically — all without any third-party service.

= Analytics and Reporting =

The dashboard shows total workflows, active workflows, total executions, executions this week, success rate, and failed execution counts. The Reports page provides execution charts with date range filtering, per-workflow breakdowns, and CSV export. Every execution is logged with a full step-by-step trace showing inputs, outputs, and error messages.

== Installation ==

1. Upload the `flowmator` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Navigate to **Flowmator** in the admin sidebar
4. Create your first workflow or install a template from the Template Library

== Frequently Asked Questions ==

= Do I need to know how to code? =

No. The visual workflow builder is a drag-and-drop canvas. You select a trigger, add actions, configure fields with point-and-click forms, and activate the workflow. No PHP, JavaScript, or SQL required.

= Does the free version include WooCommerce support? =

Yes. WooCommerce Order Created and WooCommerce Order Completed triggers, as well as the Create Coupon and Update Order Status actions, are all included in the free plugin. WooCommerce must be installed and active.

= Do AI actions require a paid plan? =

No. The three AI actions (AI Generate Text, AI Content Moderation, AI Auto-Tag) are included in the free plugin. You do need to supply your own API key from OpenAI, Google Gemini, or Groq. Those services may have their own costs depending on usage.

= Can I test a workflow before activating it? =

Yes. The Workflow Simulator runs a full dry-run execution of your workflow using real data from your site, but without sending emails, creating posts, or making API calls. You can review every step's expected input and output before going live.

= Can I send workflows to another WordPress site? =

Yes. Any workflow can be exported as a JSON file and imported on any other WordPress site running Flowmator. This works for sharing workflows between staging and production environments.

= What happens if an action fails? =

Each step in a workflow runs independently with isolated error handling. A failing step is recorded in the execution log with the error message, but it does not crash the remaining steps in the workflow. You can review failed executions from the Logs page.

= How are delays handled on busy sites? =

Delays use Action Scheduler — the same background job library used by WooCommerce and other major plugins. Delayed actions are queued as background jobs and execute reliably regardless of traffic levels.

== Screenshots ==

1. Workflow canvas — drag-and-drop builder with trigger, action, and condition nodes
2. Dashboard — execution stats, success rate, and active workflow count
3. Template Library — 20 pre-built workflow templates ready to install
4. Execution Logs — step-by-step audit trail for every workflow run
5. Reports — execution charts with date range filtering and CSV export
6. Settings — AI provider configuration, logging controls, and debug tools

== Changelog ==

= 1.0.0 =
* Initial release
* 16 built-in triggers: User Registered, User Profile Updated, User Login, User Logout, User Role Changed, User Deleted, Password Reset, Post Published, Post Updated, Post Deleted, Post Status Changed, Comment Submitted, Comment Approved, Media Uploaded, WooCommerce Order Created, WooCommerce Order Completed
* 21 built-in actions: Send Email, Create User, Update User Meta, Change User Role, Send Password Reset, Create Post, Update Post, Update Post Field, Change Post Status, Add Post Meta, Delete Post, Add Comment, Update Comment Status, Add Comment Label, Add Comment Meta, HTTP Request, AI Generate Text, AI Content Moderation, AI Auto-Tag, Create WooCommerce Coupon, Update Order Status
* Visual workflow builder with ReactFlow canvas
* Conditional branching with yes/no split nodes
* Delay scheduling via Action Scheduler (minutes, hours, days)
* Merge tag engine with system, user, post, comment, media, and WooCommerce tags
* Run-once per entity enforcement
* Workflow simulator (dry-run, no side effects)
* Workflow import and export as JSON
* Workflow notes field
* 20 free workflow templates
* Execution logging with per-step trace
* Dashboard stats and analytics
* Reports page with date filtering and CSV export
* AI actions supporting OpenAI, Google Gemini, and Groq providers
* Settings: Logging and Cleanup, Performance, License, Debug and Tools tabs
* 8 custom database tables for executions, steps, stats, variables, and approvals
* Human approval step with public token endpoint
