TECHNICAL GUIDE

15 Powerful Uncanny Automator Hooks to Customize Your Workflows

Unlock the full potential of Uncanny Automator with these essential action and filter hooks. Extend and automate your site with production-ready PHP code you can drop straight into your project.

PLUGIN Uncanny Automator
HOOKS 15

Running an automation stack with Uncanny Automator? You probably already know it makes connecting different WordPress plugins straightforward. But when you need specific logic that the standard builder does not offer, the real game-changer is hooks.

Hooks are small access points built into the core Uncanny Automator engine. They let you tweak your recipes' behavior, clean up transactional data, and optimize system speed—all without touching a single core file.

In this post, we’ll cover 15 hooks you can use today. From sanitizing tokens and securing debug output to building custom team logs and dynamic category tags, these hooks help shape your automation exactly how you want it. No overrides. No unstable hacks. Just clean, reliable PHP that keeps your automated site running smooth.

1. automator_maybe_parse_token

Sanitize email fields dynamically before they reach a recipe action.

Use case: Users frequently introduce formatting errors like trailing spaces or uppercase letters when registering or filling out forms. External CRMs and newsletter tools are highly sensitive to email syntax, which can lead to failed syncs. Automatically sanitizing token data on the fly prevents these API sync errors.

automator_maybe_parse_token.php
add_filter('automator_maybe_parse_token', 'ppunch_sanitize_email_tokens', 10, 6);
function ppunch_sanitize_email_tokens($return, $pieces, $recipe_id, $trigger_data, $user_id, $replace_args) {
    if (is_string($return) && is_email(trim($return))) {
        return strtolower(trim($return));
    }
    return $return;
}
Explanation:

This filter catches any token value right before it is sent to an active action. By checking if the return is a valid email string, it dynamically forces lowercasing and trims whitespace. You can extend this logic to format dates, clean phone numbers, or modify custom text strings.

Tokens Sanitization Filtering Data Formats

2. automator_recipe_marked_complete_with_error

Trigger a custom email notification to the site administrator when a recipe fails.

Use case: Waiting for a customer to complain about a failed automation is bad for business. If an external API is down or user permissions are blocked, you want to know immediately so you can resolve the issue before it causes customer friction.

automator_recipe_marked_complete_with_error.php
add_action('automator_recipe_marked_complete_with_error', 'ppunch_error_alert', 10, 3);
function ppunch_error_alert($recipe_id, $recipe_log_id, $complete) {
    $admin_email = get_option('admin_email');
    $recipe_title = get_the_title($recipe_id);

    $subject = 'Automator Alert: Recipe Failed';
    $body  = sprintf("The recipe '%s' (ID: %d) just failed.\n", $recipe_title, $recipe_id);
    $body .= sprintf("Check the Automator logs – Log ID: %d\n", $recipe_log_id);

    wp_mail($admin_email, $subject, $body);
}
Explanation:

This action fires the absolute millisecond a recipe logs a terminal failure. It passes the recipe ID and log ID, allowing the code to grab the admin email, fetch the recipe title, and mail a clean alert report.

Error Handling Alert Monitoring Administration

3. automator_action_completion_status_changed

Log failed actions directly to user metadata for administrative tracking.

Use case: When complex, multi-action recipes run, sometimes one step fails while the rest complete. Saving these failures to the individual user profile allows support agents to filter and diagnose problems quickly from the backend.

automator_action_completion_status_changed.php
add_action('automator_action_completion_status_changed', 'ppunch_flag_failed_user', 10, 5);
function ppunch_flag_failed_user($action_id, $recipe_log_id, $recipe_details, $completed, $error_message) {
    if ($completed !== true && isset($recipe_details['user_id'])) {
        update_user_meta(
            $recipe_details['user_id'],
            '_ppunch_automator_last_failure',
            wp_json_encode(array(
                'action_id'     => $action_id,
                'error_message' => sanitize_text_field($error_message),
                'failed_at'     => current_time('mysql'),
            ))
        );
    }
}
Explanation:

Triggers whenever an action changes its status (completed, failed, etc.). If the completed status is false, the code creates a structured JSON array containing the action ID, error message, and a timestamp, then saves it to the user's meta profile.

Actions User Meta Logging Diagnoses

4. automator_maybe_integration_active

Forcefully disable heavy integrations on public pages to boost site speed.

Use case: To catch triggers instantly, Automator loads background hooks for every active integration on every single page load. Unloading heavy triggers (like WooCommerce or BuddyBoss hooks) on public-facing landing pages improves Core Web Vitals.

automator_maybe_integration_active.php
add_filter('automator_maybe_integration_active', 'ppunch_disable_heavy_integrations', 10, 2);
function ppunch_disable_heavy_integrations($active, $integration_code) {
    $heavy = array('WC', 'BDB');
    if (!is_admin() && is_front_page() && in_array($integration_code, $heavy, true)) {
        return false;
    }
    return $active;
}
Explanation:

Intercepts active integrations on startup. If loading a frontend page like the home screen, the code returns false for specified heavy integrations to prevent their logic from loading, preserving system memory.

Performance Optimization Memory Core Web Vitals

5. automator_recipe_marked_complete

Stamp users with a completion history when they finish an automation path.

Use case: Knowing when a user has navigated all steps in a funnel is vital for client tracking. Recording these timestamps lets you run cron checks or customize front-end UI paths based on their completion history.

automator_recipe_marked_complete.php
add_action('automator_recipe_marked_complete', 'ppunch_stamp_last_recipe', 10, 2);
function ppunch_stamp_last_recipe($recipe_log_id, $completed) {
    $user_id = get_current_user_id();
    if ($user_id > 0 && $completed) {
        update_user_meta($user_id, '_ppunch_last_recipe_completed_at', current_time('mysql'));
        update_user_meta($user_id, '_ppunch_last_recipe_log_id', absint($recipe_log_id));
    }
}
Explanation:

Runs when a recipe completes its entire action sequence successfully. It identifies the logged-in user and saves the completion time and recipe log ID to their WordPress user metadata.

History Completion Timestamp User Engagement

6. automator_action_tokens_parser_loaded

Safely load custom token classes at the correct moment.

Use case: Instantiating custom token classes too early in the WordPress execution cycle will cause PHP warnings or prevent your variables from rendering correctly in the dropdown selections of the recipe editor.

automator_action_tokens_parser_loaded.php
add_action('automator_action_tokens_parser_loaded', 'ppunch_register_custom_tokens');
function ppunch_register_custom_tokens() {
    if (class_exists('Ppunch_Custom_User_Tokens')) {
        new Ppunch_Custom_User_Tokens();
    }
}
Explanation:

Triggers exactly when Automator prepares its token parser. This ensures the engine registry is fully loaded and ready, making it the safest place to initialize custom token structures.

Registry Loader Custom Tokens Execution

7. automator_should_load_automator

Bypass the Automator engine on high-frequency API endpoints to save memory.

Use case: High-concurrency REST endpoints, payment gateways, or data sync routines don't need Automator logic booting in the background. Disabling the engine on those requests lowers server response times.

automator_should_load_automator.php
add_filter('automator_should_load_automator', 'ppunch_skip_automator_on_api');
function ppunch_skip_automator_on_api($load) {
    if (isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '/wp-json/your-api-endpoint/v1/') !== false) {
        return false;
    }
    return $load;
}
Explanation:

Evaluates if the engine should boot. By checking the current URI path, you can return false, which completely halts the loading sequence of Uncanny Automator for that request to save server memory.

REST API API Optimization Load Engine Performance

8. automator_trigger_marked_complete

Record trigger stats per recipe to populate custom dashboards.

Use case: Knowing which triggers fire most frequently helps identify bottleneck processes or gauge high-intent user trends. Flat site-wide counters are not detailed enough; tracking count data on a per-recipe level is necessary.

automator_trigger_marked_complete.php
add_action('automator_trigger_marked_complete', 'ppunch_count_triggers_per_recipe', 10, 5);
function ppunch_count_triggers_per_recipe($trigger_id, $user_id, $recipe_id, $recipe_log_id, $trigger_log_id) {
    $stats = get_option('ppunch_trigger_stats', array());

    $recipe_key = 'recipe_' . absint($recipe_id);
    if (!isset($stats[$recipe_key])) {
        $stats[$recipe_key] = array(
            'title'      => get_the_title($recipe_id),
            'total'      => 0,
            'last_fired' => '',
        );
    }

    $stats[$recipe_key]['total']++;
    $stats[$recipe_key]['last_fired'] = current_time('mysql');

    update_option('ppunch_trigger_stats', $stats, false);
}
Explanation:

Fires as soon as any trigger condition resolves successfully. The snippet reads an array option, updates the counts, records the last active timestamp for the specific recipe parent, and saves it.

Trigger Stats Analytics Dashboard Logging

9. automator_recipe_imported

Tag imported recipes with audit details to track configuration changes.

Use case: On client multi-site platforms, recipes are regularly updated, exported, and imported. Tracking who imported a recipe and when creates a secure change-management history.

automator_recipe_imported.php
add_action('automator_recipe_imported', 'ppunch_tag_imported_recipes', 10, 1);
function ppunch_tag_imported_recipes($new_recipe_id) {
    update_post_meta($new_recipe_id, '_ppunch_imported_at', current_time('mysql'));
    update_post_meta($new_recipe_id, '_ppunch_imported_by', get_current_user_id());
}
Explanation:

Fires once a recipe import successfully saves to the database. The code stamps the new recipe post ID with metadata recording the import timestamp and the user ID of the operator.

Multi-site Audit Trail Import Post Meta

10. automator_user_role_changed

Track user role updates reliably through a single normalized hook.

Use case: WordPress role-change hooks are notoriously inconsistent, firing differently depending on the action performed. Having a unified hook ensures your role-based automations and internal logs always run reliably.

automator_user_role_changed.php
add_action('automator_user_role_changed', 'ppunch_sync_role_externally', 10, 3);
function ppunch_sync_role_externally($user_id, $new_role, $old_roles) {
    $user = get_userdata($user_id);
    if (!$user) {
        return;
    }
    error_log(sprintf(
        '[PluginPunch] User %s (ID: %d) role changed from [%s] to [%s]',
        $user->user_email,
        $user_id,
        implode(', ', $old_roles),
        $new_role
    ));
}
Explanation:

Normalizes role changes into a single hook. The code snippet logs the email, ID, and old-to-new role pathways into the standard server log, providing a clean audit trail.

Roles Sync Normalized Hooks Audit Logs

11. automator_recipe_trigger_created

Log the addition of new triggers in collaborative team environments.

Use case: Unexpected trigger edits on production automation recipes can break live customer flows. Logging trigger additions helps your team identify when changes were introduced and who made them.

automator_recipe_trigger_created.php
add_action('automator_recipe_trigger_created', 'ppunch_log_trigger_created', 10, 3);
function ppunch_log_trigger_created($post_id, $item_code, $request) {
    $recipe_id    = wp_get_post_parent_id($post_id);
    $recipe_title = $recipe_id ? get_the_title($recipe_id) : 'Unknown';

    error_log(sprintf(
        '[PluginPunch] New trigger "%s" (Post ID: %d) added to recipe "%s" (ID: %d) by user %d',
        sanitize_text_field($item_code),
        $post_id,
        $recipe_title,
        $recipe_id,
        get_current_user_id()
    ));
}
Explanation:

Triggers whenever a user saves a new trigger inside the recipe builder. It captures the trigger item code, the post ID, and logs the change to your server log for clear change tracking.

Change Logs Trigger Created Collaborative Teams Logging

12. automator_recipe_action_created

Auto-categorize automation recipes based on the integrations they use.

Use case: On complex sites with dozens of active automation pipelines, organizing the recipe dashboard becomes difficult. Automatically tagging recipes by action type simplifies dashboard organization.

automator_recipe_action_created.php
add_action('automator_recipe_action_created', 'ppunch_auto_tag_recipe_by_action', 10, 3);
function ppunch_auto_tag_recipe_by_action($post_id, $item_code, $request) {
    $recipe_id = wp_get_post_parent_id($post_id);
    if (!$recipe_id) {
        return;
    }

    $email_actions = array('SENDEMAIL', 'SENDADMINEMAIL', 'WPSENDMAIL');
    if (in_array(strtoupper($item_code), $email_actions, true)) {
        wp_set_object_terms($recipe_id, 'email', 'recipe_category', true);
    }

    if (strpos(strtoupper($item_code), 'WC') === 0) {
        wp_set_object_terms($recipe_id, 'woocommerce', 'recipe_category', true);
    }
}
Explanation:

Inspects the item code of new actions. If an email or WooCommerce action code is detected, the parent recipe is instantly tagged with the corresponding category term in your database.

Taxonomy Categorization Dashboard Organization Auto Tagging

13. automator_recipe_status_updated

Send a publish alert to the team when an automation recipe goes live.

Use case: Unintentionally activating an unfinished recipe or draft automation in production can trigger unintended transactional events. Notifying the team immediately helps prevent support errors.

automator_recipe_status_updated.php
add_action('automator_recipe_status_updated', 'ppunch_notify_on_publish', 10, 4);
function ppunch_notify_on_publish($post_id, $recipe_id, $post_status, $return) {
    if ($post_status !== 'publish') {
        return;
    }
    $recipe_title = get_the_title($recipe_id);
    $admin_email  = get_option('admin_email');

    wp_mail(
        $admin_email,
        'Recipe Published: ' . $recipe_title,
        sprintf("The recipe '%s' (ID: %d) was just set to Live.", $recipe_title, $recipe_id)
    );
}
Explanation:

Runs whenever a recipe updates its status. The code filters for the 'publish' status to dispatch an email notification to the site administrator when a recipe goes live.

Status Updates Publish Alerts Production Notifications

14. automator_get_recipes_data

Hide internal system recipes from the standard dashboard list.

Use case: Developers often configure deep background processes that keep user profiles or databases in sync. Hiding these from client-accessible dashboard lists prevents accidental deletion or edits.

automator_get_recipes_data.php
add_filter('automator_get_recipes_data', 'ppunch_hide_system_recipes', 10, 2);
function ppunch_hide_system_recipes($recipes, $recipe_id) {
    if (!is_array($recipes)) {
        return $recipes;
    }
    $hidden_ids = array(101, 102);
    foreach ($recipes as $key => $recipe) {
        if (isset($recipe['ID']) && in_array((int) $recipe['ID'], $hidden_ids, true)) {
            unset($recipes[$key]);
        }
    }
    return array_values($recipes);
}
Explanation:

Inspects the recipe list prior to loading the admin screen. The filter checks the list against an array of system recipe IDs and dynamically unsets them from the dashboard list.

Security Hidden Recipes Admin Controls Client Sites

15. automator_before_recipe_logs_cleared

Log log-clearing operations to maintain a secure audit log.

Use case: Wiping execution logs is standard practice for database size control, but doing so blindly erases error debugging histories. Tracking who cleared log data and when protects administrative operations.

automator_before_recipe_logs_cleared.php
add_action('automator_before_recipe_logs_cleared', 'ppunch_backup_logs_before_clear', 10, 1);
function ppunch_backup_logs_before_clear($recipe_id) {
    $recipe_title = get_the_title($recipe_id);
    error_log(sprintf(
        '[PluginPunch] Logs for recipe "%s" (ID: %d) are about to be cleared by user %d at %s',
        $recipe_title,
        $recipe_id,
        get_current_user_id(),
        current_time('mysql')
    ));
}
Explanation:

Fires right before logs clear database tables. The script captures the parent recipe title and ID and logs the request along with the clearing user ID to the permanent server log.

Log Cleaning Change Audit Backups Server Logs
KNOWLEDGE BASE

Common Questions

Yes. We regularly build custom integrations and triggers for clients. Get in touch with us!
Absolutely. If the plugin fires standard WordPress hooks, we can wire it into Automator as a custom trigger or action. Get in touch with us!
No. Add the code to a small site‑specific plugin or your child theme's functions.php — either way, no core Automator files are touched.
Yes. Hooks run outside the core plugin, so updates won't overwrite your code.
Yes. We specialize in diagnosing complex Automator recipe failures. Get in touch with us!
// AUTHOR Muneeb K. Lead WordPress Developer

16 years building custom WordPress plugins for WooCommerce, MemberPress, and LearnDash platforms — 500+ projects delivered. Focused on performance, stability, and clean architecture.

MemberPress Expertise

Need a custom Uncanny Automator workflow?

Contact our team for a free audit and let us build the hooks that power your automations.

// TECH STACK

Tools We Master
Inside Out.

Starting with WordPress at the core, we use a curated stack of powerful tools to build fast, stable, and scalable systems for your business.