Initiates a user-defined workflow.
A user-defined workflow is a custom workflow that defines and manages the sequencing of multiple operations. Each operation in a user-defined workflow represents an expensive or long-running process that is submitted to the workflow engine as a job for processing. Four types of operations are supported: geohaz
, group
, process
, and batch
. These operations map to existing Risk Modeler workflow jobs.
Cat Modeling Workflow Recipe
To learn how this operation may be used to define end-to-end catastrophe modeling processes, see Cat Modeling with User-defined Workflows.
Operation object
The operations
array consists of multiple operation
objects. Each operation
object is identified by four attributes: label
, operation
, dependsOn
, and input
:
- The
label
attribute uniquely identifies the operation within the workflow. Operations are identified bylabel
value in the in thedependsOn
array and operation path variables. - The
operation
attribute identifies the operation type. Depending on thetype
(AccountWorkflow
orPortfolioWorkflow
) the job may support two or three types of operations. Account workflow jobs supportgeohaz
,process
, andbatch
operations. Portfolio workflow jobs supportgeohaz
,group
,process
, andbatch
operations. Theoperation
attribute may also be defined as an endpoint. See Operation types. - The
dependsOn
attribute specifies (bylabel
value) an array of operations to be run before the current operation. Using thedependsOn
attribute you can specify the order that operations are executed within a user-defined workflow job. For example, executing ageohaz
operation before aprocess
operation, and one or moreprocess
operations before agroup
operation. - The
input
attribute is an object that defines operation type-specific data. Depending on theoperation
value specified, theinput
object may represent the request body of needed by the Geohazard account, Geohazard portfolio, Create analysis group, Analyze account, or Analyze portfolio services.
Operation types
The operation
attribute identifies an action performed on a specific account or portfolio exposure. This operation may be identified by a keyword that identifies the operation type or by an endpoint path.
The operation
attribute accepts attribute accepts four operation type values: geohaz
, group
, process
, and batch
:
- The
geohaz
operation geohazards the account or portfolio. ForaccountWorkflow
jobs, the operation initiates an account-levelGEOHAZ
job. For details see Geohazard account. ForportfolioWorkflow
jobs, the operation initiates a portfolio-levelGEOHAZ
job. For details see, Geohazard portfolio. - The
group
operation creates an analysis group for portfolio analysis results. For details, see Create analysis group (POST /v2/analysis-groups
). - The
process
operation analyzes the account or portfolio. ForaccountWorkflow
jobs, the operation analyzes the account. For details, see Analyze account(/v2/accounts/{accoutId}/process
). ForportfolioWorkflow
jobs, the operation analyzes the portfolio. For details, see Analyze portfolio (POST /v2/portfolios/{id}/process
). - The
batch
operation type adds, updates, or deletes groups of exposures. Exposures are managed at the account-level, portfolio-level, location-level, or treaty-level. For details, see Manage exposures in batch (/v3/exposurebatches
).
The operation
attribute also accepts an endpoint path that identifies the type of operation performed. If the operation type is defined by an endpoint, the request may use an operation path variable to identify a specific portfolio or account exposure.
The following endpoint paths are accepted for each operation type:
geohaz
operations:
/v1/accounts/{id}/geohaz
/v2/accounts/{id}/geohaz
/v1/portfolios/{id}/geohaz
/v2/portfolios/{id}/geohaz
process
operations:
/v2/portfolios/{id}/process
/v1/portfolios/{id}/process
/v1/accounts/{id}/process
/v2/accounts/{id}/process
group
operations:
/v1/analysis-groups
/v2/analysis-groups
batch
operations:
/v3/exposurebatches
Operation path variables
Operation path variables enable you to specify the portfolio or account exposure that is the subject of an operation.
The operation
path variable uses a JSON query string to retrieve data a previous operation output. Every operation is defined by a unique label and this label may be used to query the output of that operation in subsequent operations.
For example, you may define a batch
operation (accountlabel1
)to create a new account. A subsequent geohaz
operation (geohazJob
) in the same user-defined workflow may use an operation path variable to set the account ID in the operation path:
{
"operation" : "/v1/accounts/{{$..[?(@.label =='accountLabel1')].id}} /geohaz/?datasource={{datasourceName}}",
"label" :"geohazJob",
...
}
The {{$..[?(@.label == 'accountLabel1')].id}}
variable defines a query for retrieving the output generated by the accountLabel1
operation. During processing, the workflow engine "expands" this query to retrieve the unique ID number for this account using the path (label.output.id
). The path variable is a simple JSON query string enclosed in double curly braces.
Permissions
To perform this operation, a principal must be assigned the appropriate role-based permissions:
Underwriter Technical Underwriter Risk Analyst Portfolio Manager Cat Modeler Yes Yes No No No