Using a Subflow as a Sink

You can use a subflow as the last stage in a dataflow to write data to a file or database and even perform some processing on the data before writing the data to the output destination. You can create a subflow as simple as a single sink stage that is configured in a way that you want to reuse in multiple dataflows, or you could create a more complex subflow that processes data in some way before writing it to the output destination.

  1. In Enterprise Designer, click File > New > Dataflow > Subflow.
  2. Drag an Input stage from the palette to the canvas.
  3. Double-click the Input stage and add the fields that the subflow will receive from the dataflow in which it is used.
  4. After configuring the Input stage, add additional stages as needed to perform the post-processing that you want.
  5. At the end of the subflow, add the appropriate sink.

    For example, if you created a subflow that uses a Transformer stage to trim white space and standardize the casing of a field then writes it to a database, you would have a subflow that looks like this:

  6. Select File > Save and save the subflow.
  7. Select File > Expose to make the subflow available to include in dataflows.
  8. In the dataflow where you want to include the subflow, drag the subflow from the palette onto the canvas and connect it to the last stage in the dataflow.
    Note: Since the subflow contains a sink stage rather than an Output stage, the subflow icon only has an input port. It can only be used as a sink in the dataflow.

    The parent dataflow now uses the subflow you created as a sink. For example, if you created a subflow named "Transform and Write to DB" and you add the subflow and connect it to a Geocode US Address stage, your dataflow would look like this: