You must be aware of the guidelines for using Workflow Automation building blocks.
More information
Guidelines for SQL in WFA
You must be aware of the guidelines for using SQL in OnCommand Workflow Automation (WFA) to write SQL queries for WFA.
Guidelines for WFA functions
You can create functions to encapsulate commonly used and more complex logic in a named function, and then reuse the function as command parameter values or filter parameters values in OnCommand Workflow Automation (WFA).
Guidelines for creating data source types
You must be aware of the guidelines for creating data source types that are used to define custom data sources for OnCommand Workflow Automation (WFA).