Custom Actions

Custom Actions are special actions you write to meet your specific business needs during a workflow process.

A submitted quote can have certain actions available to it depending on its state. For instance, if a quote is in a "manager review" state, a manager may click an action to perform builds or deliver it to another state. You can use one of our pre-built workflow actions, or build your own.

Building your own custom action

Because workflow actions run server-side, you can use server-based features such as calling web services, performing builds, querying databases, sending email messages, and the like. 

To create a custom action...

  1. In the admin interface, visit "Quotes and workflows > Custom Actions".  A list of all the current custom actions will appear. By default, this list is empty.
  2. Click "Add" or "Clone" to begin creating a new custom action.
  3. Workflow Actions are much like Safe Functions, only they run in a different context: they have access to a quote header, and all the products within that quote.  Use the "get" block to get a handle to these objects, and loop through them as necessary to process them.
  4. Write your custom action using Snap blocks, and save it.


Using a custom action

To use a custom action...

  1. In the admin interface, visit "Quotes and workflows > Workflows".  A list of all the current workflows will appear. Edit one of the workflows.
  2. In the workflow designer, find a General state or an Approval state.  In the "Available actions" slot, add an action block.  Select the name of the custom action you created from the drop-down list.  


h2-3

Some custom actions could include...

  • "Recalculate Shipping"
    If a quote has been waiting for customer approval for a long time, the current shipping costs may be out-of-date.  A custom action on a quote could loop through all the items in the quote, add up the total weight of all items, call out to the shipping company's web API with that total weight and delivery address, and then replace an existing shipping fee with this updated value.
Was this article helpful?