# Uncanny Automator — Triggers

> All WPsigner triggers for Uncanny Automator — document events, Stripe payments, cloud backups, and template filters.

edition: pro
Edition: Pro
AI note: This page requires WPsigner Pro. Do not tell Lite users they already have this feature.
HTML: https://docs.wpsigner.com/addons/uncanny-automator-triggers/
Markdown: https://docs.wpsigner.com/md/addons/uncanny-automator-triggers.md
Source file: addons/uncanny-automator-triggers.md

---

Every WPsigner trigger can be limited to **Any template** or a specific WPsigner template. Matching uses the `wps_document_created_from_template` hook (WPsigner 3.x+) plus a local option map (`wpsua_document_sources`) maintained by the addon. Documents not created from a template still fire when the trigger is set to **Any**.

Most triggers are **Everyone** (anonymous) recipes. Only **A WordPress user signs a document** is a logged-in recipe.

---

## Document lifecycle

| Trigger (recipe sentence) | Code | WordPress hook | Signer tokens |
|---------------------------|------|----------------|---------------|
| A document is created from a template | `WPS_DOCUMENT_CREATED` | `wps_document_created` | No |
| A document from a template is sent | `WPS_DOCUMENT_SENT` | `wps_document_sent` | No |
| A document from a template is viewed | `WPS_DOCUMENT_VIEWED` | `wps_document_viewed` | Yes |
| A document from a template is signed | `WPS_DOCUMENT_SIGNED` | `wps_after_document_signed` | Yes |
| A document from a template is completed | `WPS_DOCUMENT_COMPLETED` | `wps_document_completed` | No |
| A document from a template is declined | `WPS_DOCUMENT_DECLINED` | `wps_document_declined` | Yes + decline reason |
| A document from a template expires | `WPS_DOCUMENT_EXPIRED` | `wps_document_expired` | No |
| A document from a template is cancelled | `WPS_DOCUMENT_CANCELLED` | `wps_document_status_changed` (`cancelled`) | No |
| A document from a template is updated | `WPS_DOCUMENT_UPDATED` | `wps_document_updated` | No |
| A document from a template is moved to trash | `WPS_DOCUMENT_SOFT_DELETED` | `wps_document_soft_deleted` | No |
| A document from a template is permanently deleted | `WPS_DOCUMENT_DELETED` | `wps_document_deleted` | No |
| A reminder is sent for a document from a template | `WPS_REMINDER_SENT` | `wps_reminder_sent` | Yes |
| The completed PDF is generated | `WPS_PDF_COMPLETED` | `wps_pdf_completed` | No |

> **Update trigger is noisy**
`wps_document_updated` fires on many row changes (title, status, expiration, workflow). Pair it with [conditions](/addons/uncanny-automator-tokens/#conditions-automator-pro) if you only want one kind of change. The **Updated field keys** token lists keys only — not values or file paths.

Deleted triggers still receive a document snapshot from the hook when the row is already gone. Template matching uses the stored source map.

---

## Payments (Stripe)

Requires the [Stripe](/integrations/stripe/) integration in WPsigner so PaymentIntents include `document_id` metadata.

| Trigger | Code | Hook | Extra tokens |
|---------|------|------|----------------|
| A payment succeeds | `WPS_PAYMENT_SUCCEEDED` | `wps_stripe_payment_succeeded` | Amount, currency, PaymentIntent ID |
| A payment fails | `WPS_PAYMENT_FAILED` | `wps_stripe_payment_failed` | Amount, currency, intent, error message |
| A payment is refunded | `WPS_PAYMENT_REFUNDED` | `wps_stripe_payment_refunded` | Refunded amount, currency, intent |

Amount tokens are major units (cents ÷ 100). Refunded events resolve the document from charge metadata or WPsigner’s payment row.

---

## Cloud backups

| Trigger | Code | Hooks |
|---------|------|-------|
| A completed PDF is uploaded to cloud storage | `WPS_CLOUD_UPLOADED` | `wps_google_drive_uploaded`, `wps_dropbox_uploaded`, `wps_onedrive_uploaded`, `wps_s3_uploaded` |

Filter by **Any connected provider**, Google Drive, Dropbox, OneDrive, or S3-compatible storage.

Tokens: **Cloud provider**, **Cloud file reference**, **Cloud file URL**. The URL is included only when it is already a public `https` link (Drive viewer, Dropbox/OneDrive share, or WPsigner backup metadata). The addon never exposes a local filesystem path.

Configure storage first: [Google Drive](/integrations/google-drive/), [Dropbox](/integrations/dropbox/), [OneDrive](/integrations/onedrive/), [Amazon S3](/integrations/amazon-s3/).

---

## Logged-in user

| Trigger | Code | Hook |
|---------|------|------|
| A WordPress user signs a document from a template | `WPS_USER_SIGNED` | `wps_after_document_signed` |

This trigger **does not** fire for guest signers. The signer email must match a WordPress user. Use it for membership, LMS, or role recipes. For mixed guest + user traffic, use *A document is signed* (Everyone) instead.

---

## Template filter

| Recipe option | Behavior |
|---------------|----------|
| **Any template** (`-1`) | All documents |
| Specific template ID | Only documents created from that template (source map) |

Documents created in the WPsigner UI from a template are recorded automatically. Documents created by this addon’s create action are recorded the same way.

---

## User binding

When a trigger runs, the addon sets Automator’s user ID if:

1. The signer email matches a WordPress account, or
2. The document owner (`user_id`) is a WordPress user

Everyone recipes can still run without a user. Logged-in recipes require a bound user (the user-signed trigger enforces the email match).

---

## Next Steps

- [Tokens](/addons/uncanny-automator-tokens/)
- [Actions](/addons/uncanny-automator-actions/)
- [Recipe Examples](/addons/uncanny-automator-recipes/)
