Create user-defined workflow

Initiates a user-defined workflow consisting of multiple operations. Each operation in the workflow defines a job that is submitted to workflow engine. Four types of operations are supported: geohaz, group, process, and batch. Operations may specified by keyword or endpoint path.

The user-defined workflow manages the both the sequencing of operations within the workflow job and the reporting of operation and workflow status.

All parameters are specified in the request body.

  • The name parameter identifies the user-defined workflow.
  • The optional type parameter identifies the exposures managed based on the job type (AccountWorkflow or PortfolioWorkflow).
  • The operations parameter defines an array of operation objects.


Role-based access controls

To perform this operation, the client application must be assigned the Underwriter or Technical Underwriter role. See Groups and roles for details.


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 by label value in the in the dependsOn array and operation path variables.
  • The operation attribute identifies the operation type. Depending on the type (AccountWorkflow or PortfolioWorkflow) the job may support two or three types of operations. Account workflow jobs support geohaz, process, and batch operations. Portfolio workflow jobs support geohaz, group, process, and batch operations. The operation attribute may also be defined as an endpoint. See Operation types.
  • The dependsOn attribute specifies (by label value) an array of operations to be run before the current operation. Using the dependsOn attribute you can specify the order that operations are executed within a user-defined workflow job. For example, executing a geohaz operation before a process operation, and one or more process operations before a group operation.
  • The input attribute is an object that defines operation type-specific data. Depending on the operation value specified, the input 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. For accountWorkflow jobs, the operation initiates an account-level GEOHAZ job. For details see Geohazard account. For portfolioWorkflow jobs, the operation initiates a portfolio-level GEOHAZ 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. For accountWorkflow jobs, the operation analyzes the account. For details, see Analyze account(/v2/accounts/{accoutId}/process). For portfolioWorkflow 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 ( The path variable is a simple JSON query string enclosed in double curly braces.