Workflows

Workflows automate actions that run when a transaction succeeds on a donor-facing form. They are the primary tool for post-transaction automation: sending custom emails, running scripts, updating records, and integrating with external systems — all triggered automatically by a completed gift or registration.

How Workflows Run

When a donor completes a form transaction:

  1. All Workflows defined on the form run (in order)
  2. For each item in the transaction, all Workflows defined on that item run

Each Workflow evaluates its own condition before executing. If the condition is false, the Workflow is skipped entirely. Within a Workflow, each Action also has its own condition.

Creating a Workflow

Workflows are found on the Integration sidebar in DonorPoint.

  1. Go to Integration > Workflows.
  2. Click Create New Workflow.
  3. Enter a Name and optional description.
  4. Set the Condition (see below) — if blank, the Workflow always runs.
  5. Add Actions on the Actions tab.
  6. Save.

To attach a Workflow to a form or item:

  • On a Form (campaign): open the form, go to the Scripting tab, and add the Workflow to the Workflow list.
  • On an Item: open the item, go to the Scripting tab, and add the Workflow.

Workflow Conditions

A Workflow condition is a JSF EL expression that evaluates to "true" or "false". The Workflow only runs when the condition is true.

# Run only for gifts over $1000:
purchaseOrder.amount > 1000

# Run only for a specific payment method type:
purchaseOrder.payment.paymentMethod.name contains 'Payroll'

# Run only when a specific item was purchased:
purchaseOrder.orderItems.size() > 0 and purchaseOrder.orderItems[0].orderableItem.name eq 'Annual Fund'

# Always run (leave condition blank):
(blank)

Workflow Action Types

Each Workflow contains one or more Actions executed in order. Each Action can also have its own condition.

Email Action

Sends an email when triggered. Configuration:

Property Description
To Recipient email address — can be an EL expression: #{contact.email}
Subject Email subject — can include EL expressions
Body Email body — can include merge tags and EL
Email Template Optionally, use an existing Email Definition as the template
From Name Sender display name
From Address Sender email address

The contact, campaign, and purchaseOrder variables are available in the email body. All standard merge tags work.

Common uses:

  • Notify a major gifts officer when a gift exceeds a threshold
  • Send a custom acknowledgment to a tribute recipient
  • Alert staff when a payroll pledge comes in from a VIP organization

Script Action

Executes a Script Module when triggered. The script has access to:

  • this — the transaction (PurchaseOrder) or order item
  • user — the donor’s UserAccount (if logged in)
  • account — your account
  • All standard import-able CDI services

Common uses:

  • Create a follow-up task in the CRM
  • Update a custom field on the contact based on the gift amount
  • Post transaction data to an external API
  • Create a recurring donation record

Action Conditions

Each action within a Workflow has its own condition, evaluated after the Workflow condition passes. This allows a single Workflow to take different actions for different scenarios:

# Email action condition — send VIP email only for large gifts:
purchaseOrder.amount >= 5000

# Script action condition — always run the script:
(blank)

Workflow Variables in Scripts

When a Script action runs, these variables are available:

Variable Content
this The PurchaseOrder (form context) or OrderItem (item context)
purchaseOrder The PurchaseOrder (always available, even in item context)
contact The donor contact
campaign The form that generated the transaction
user The donor’s UserAccount (may be null for anonymous gifts)
account Your DonorPoint account

Common Workflow Patterns

Major Gift Notification

Condition: purchaseOrder.amount >= 1000

Email Action:

  • To: major.gifts@yourorg.org
  • Subject: New major gift: $#{purchaseOrder.amount} from #{contact.firstName} #{contact.lastName}
  • Body: Contact info, gift amount, campaign, and a link to the transaction record

Post-Transaction CRM Update

Condition: (blank — always run)

Script Action — Script Module: “UpdateContactGivingTier”:

import "contactService";

var amount = purchaseOrder.amount;
var tier = amount >= 10000 ? 'MAJOR' : amount >= 1000 ? 'MID' : 'STANDARD';

contactService.setCustomProperty(contact, 'GivingTier', tier);
log.info('Set giving tier to ' + tier + ' for contact ' + contact.id);

Tribute Notification

Condition: purchaseOrder.orderItems.size() > 0 and purchaseOrder.orderItems[0].get('TributeName') != null

Email Action:

  • To: #{purchaseOrder.orderItems[0].get('NotificationEmail').value}
  • Subject: A gift has been made in your honor
  • Body: Custom tribute acknowledgment message

Troubleshooting

If a Workflow is not running:

  1. Check that the Workflow is attached to the form or item (Scripting tab)
  2. Check that the Workflow’s Active flag is checked
  3. Check that the Workflow condition evaluates to "true" for your test transaction — use the Test Script feature on the Workflow edit page
  4. Check the server log for script errors if a Script action is involved (contact help@donorpoint.com to request a log review)