Exporting a flow from NiFi Registry

This procedure shows you how to use the NiFi Toolkit CLI to export a versioned flow from a Registry instance.

  1. List the flows in the bucket that you want to explore.
    You get the list of the flows in the chosen bucket.
    In this example, the flows of the TestProject bucket are listed:
    john.doe@john bin % ./cli.sh registry list-flows -bucketIdentifier 2a5566b5-7380-46b8-9598-328e092e8899
    # Name      Id                                      Description
    - -------   ------------------------------------    -----------
    1 BaseFlow  06acb207-d2f1-447f-85ed-9b8672fe6d30    First flow.
    2 TestFlow  ce2fdaf9-bf81-43fa-846f-f38f6891be95    Second flow.
  2. Export a flow from the Registry to a defined location using the flow ID.
    In this example, you export TestFlow as a JSON file called mytestflow.json to the tmp folder:
    john.doe@john bin % ./cli.sh registry export-flow-version -f
              ce2fdaf9-bf81-43fa-846f-f38f6891be95 -o /tmp/mytestflow.json -ot json
    where -f specifies the flow ID, -o specifies the name of the output file, and -ot specifies the output type.
The flow is exported as a JSON file, so you have a NiFi flow definition on your local machine that you can import and deploy, for example in a different NiFi instance.