What's New

Workflow Rule

By - Updated April 10, 2019

A Workflow Rule allows you to run SQL statements upon workflow actions, such as Post, Approve, Reject, etc.

Use Case

In this example, we have an advanced workflow configured for Revenue Planning. We would like to archive Forecast data when an Approver clicks “Approve” on the Dashboard Action Menu.

Add Workflow Rule

1. Navigate to the MODELER module.

Note: To use this feature, you need to upgrade to the latest Kepion, version 6.0.18150 or later.

2. Click Application -> All Workflow Rules.

3. Click Add.

4. Give the rule a name, and click OK.

You now have an empty rule that you can begin to configure.


1. Click Edit to get started.

2. Enter a SQL script in the rule window.

3. Click Save to confirm your change.

The key is to use the system parameter @ActivityID, and the system table [dbo].[Activities] and [dbo].[Constants].

  • @ActivityID: System parameter of type INT that you can use directly without declaration.
  • [dbo].[Activities]: System table that tracks user interaction with a workflow, e.g. SubmissionType, SubmissionID, UserID, Timestamp, etc.
  • [dbo].[Constants]: System table that lists out the possible options for SubmissionType, and options for other objects.
  • [dbo].[Authorizations]: System table that lists out configuration details about a workflow, including Dashboard and Workbook.

Now you’ve completed the configuration for a workflow rule.

Other Use Cases

There is a lot more you can use this feature for. A Workflow Rule can be triggered by the following Actions:

  • Approve
  • Discard
  • Post
  • Recall
  • Reject
  • Save
  • Submit

SQL scripts to help explore the system tables: