Creating and Running Workflows
A workflow is a linked collection of pebbles where a given pebble's output is routed to one or more pebble's inputs.
The Workflow Library
The Pebble Flow Workflow Server's workflow tab is where you will find built workflows. In the example below, there is a single workflow in the library named "Bond Analysis".

This workflow is composed of three pebbles: Bond Analysis, Bond Amortization, and Bond Present Value. You can find them in the Pebble Library.

Let's build this workflow!
Building a workflow
To build a workflow we must first name it. We can create a new workflow by clicking on the "workflows" link, then clicking on the "+" button on the Manage Workflows tab.

Clicking on the "+" button will pop up the "Create Workflow" modal.

Provide a workflow name and a detailed description, then click the "build" button. This is will create your new workflow and take you to the following screen.

Click on the "Build Workflow" tab to create new workflows. On the left panel you will see a list of pebbles in your pebble library. On the right is your builder panel.

Click on a pebble to see all of its versions. In this example, we clicked on the "Bond Amortization" pebble.

Click on a version to view the pebble detail.

Click "add" to add this specific version of the Bond Amortization pebble to the workflow.

To add another pebble to the workflow, choose another pebble from the library.
Connecting Pebbles
Pebbles are automatically connected when added to the workflow. Whenever a pebble is added to the workflow, the workflow builder checks to see which pebble output worksheets map to the added pebble's inputs. If no pebbles' output worksheets map to the added pebble's inputs, the pebble will sit isolated on the workflow.
Isolated pebbles are allowed and will be executed whenever the workflow is executed.
Types of Pebble Worksheet Connections
There are three types of pebble connections, namely all, each, and group.
The All Worksheet Connection
When a one pebble's output worksheet is connected to another pebble's input worksheet, and it is labelled as an "all" connection, all of the rows produced in the output worksheet will be passed to the other pebble's input worksheet. The following example shows the "Stage-2-Group-Test" pebble passing all of the rows produced by its "Double" output worksheet to the "Double" input worksheet of the "Stage-4-Group-Test" pebble.

If the pebbler does not specify another type of worksheet connection, the default connection chosen by the builder is always "all".
Choose "all" as a worksheet connection whenever all of the rows produced by an output worksheet are required by the input worksheet.
The Each Worksheet Connection
The "each" worksheet connection specifies that each date row in the output worksheet should be processed separately in the input worksheet. This will result in the same spreadsheet being executed as many times as there are rows in the output spreadsheet's worksheet.

In the example above, the Bond Amortization spreadsheet will be executed as many times as there are data rows in the Bond Present Value output worksheet "Present Value".
A pebble may only have 1 each or group connection in a given workflow. All other worksheet connections for that pebble must be all connections.
The workflow builder needs to be told that an input worksheet expects an "each" connection. This is done by adding a pebblestream:hint directive with the following specification in the input worksheet:
pebblestream:hint(“pebblestream-workflow”,”each”)
The following shows what that hint looks like in Microsoft Excel.

The "each" workflow hint allows for simpler spreadsheet calculations.
Choosing "each" as a worksheet connection can result in scaled computing as each row will be processed by a separate computing thread.
The Group Worksheet Connection
The "group" worksheet connection specifies that groups of rows in the output worksheet should be processed separately in the input worksheet. This will result in the same spreadsheet being executed as many times as there are unique groups in the output spreadsheet's worksheet.

In the example above, the Bond Amortization Summary spreadsheet will be executed as many times as there are data rows in the Bond Amortization output worksheet "Amortization Schedule".
A pebble may only have 1 each or group connection in a given workflow. All other worksheet connections for that pebble must be all connections.
The workflow builder needs to be told that an input worksheet expects an "each" connection. This is done by adding a pebblestream:hint directive with the following specification in the input worksheet:
pebblestream:hint(“pebblestream-workflow”,”group”)
The following shows what that hint looks like in Microsoft Excel.

The "group" workflow hint allows for simpler spreadsheet calculations.
Choosing "group" as a worksheet connection can result in scaled computing as each row will be processed by a separate computing thread.
Be intentional about choosing all, each, or group worksheet connections. The choice of worksheet connection can influence process time and memory allocation.
Updated 3 days ago