Flows API
  • Globus Flows
  • Overview
  • Getting Started
    • How to Run a Flow
    • How to Monitor a Flow Run
    • How to Create a Flow
    • How to Manage High Assurance Flows
  • Authoring Flows
    • Introduction
    • Actions
    • Expressions
    • Choice States
    • Wait States
    • CreateWebInput States
    • AwaitWebInput States
    • Fail States
    • Pass States
    • Protecting Secrets
    • Handling Exceptions
    • Performing Actions as Different Users
    • Run Context
    • Validating Flow Definitions
    • High Assurance Flows
  • Authoring Input Schemas
  • Registered APIs
    • Feature Overview
    • Tutorials
    • Explanations
    • How-tos
    • Reference
    • The Globus Registered API CLI
  • Web Inputs
    • Feature Overview
    • Controlling Access
    • Notifying Respondents
    • Responding
  • Authentication and Authorization
  • Consents and Resuming Runs
  • Permissions
  • Limits
  • Hosted Registered APIs
    • Usage notes
    • Globus Groups Registered APIs
    • Globus Search Registered APIs
  • Hosted Action Providers
    • Hello World
    • Globus Search - Ingest Task
    • Globus Search - Delete Task
    • Send Notification Email
    • Wait For User Selection
    • Expression Evaluation
    • DataCite Mint
    • Transfer APs
    • Compute AP
  • Example Flows
    • Simple Transfer
    • Move (copy and delete) files
    • Evaluate preliminary results
    • Transfer and Share Files
    • Approved publication
    • Two Stage Globus Transfer
    • Web Inputs: Admin signoff
    • Transfer After Approval
    • Looping Batched Move
    • Tar and Transfer for collections with an associated flow policy
    • Tar and Transfer with Globus Compute
Skip to main content
Globus Docs
  • Getting Started
    Getting Started

    Getting Started and Tutorial docs cover how to perform some activity or provide an introduction to a feature. They are not comprehensive, but help you get started with Globus or with new Globus features.

    • Users
    • Admins
    • Developers
  • Reference
    Reference
    • Service
      • Auth
      • Groups
      • Transfer
      • Timers
      • Flows
      • Compute
      • Search
    • Agents
      • Globus Connect Server
      • GCS CLI
      • Globus Connect Personal
      • Globus Compute
    • SDK
      • Python
      • JavaScript/TypeScript
    • Clients
      • CLI
    • Security and Compliance
      • Product Security
      • Privacy
      • Solutions for Sensitive Data
      • FAQs
  • Solutions & Guides
    Solutions & Guides

    Find practical approaches for leveraging Globus in research environments, integrating with platforms, and building science gateways. Access hands-on guides, integration instructions, and real-world scenarios for advanced usage.

    • Portals/Science Gateways
    • Guides
  • Support
    Support

    Find answers to frequently asked questions, connect with the community by joining our mailing lists, or reach out directly to Globus support.

    • FAQs
    • Mailing Lists
    • Contact Us
    • Check Support Tickets
  • Site Search
  1. Home
  2. Globus Services
  3. Globus Flows
  4. Example Flows
  5. Approved publication

Approved publication

Try it out in the Flows IDE.

Description

Web Inputs can be used to gate publication of reports.

This example demonstrates this hypothetical workflow:

  • An instrument has generated some data that must be analyzed.

  • A user starts this example flow and selects a path on a collection as the flow input.

  • The collection ID and path are passed to a Globus Compute function which analyzes the data, generates a PDF, and returns some info about the analysis.

  • A Web Input is created so an admin group can decide whether to publish the report.

In the example flow, the report is always ingested to Globus Search, but it is only visible to a private group by default. If an administrator approves publication, the report is made visible to the public.

Source code

def analyze_data(id, path):
    import datetime
    import pathlib

    report_path = pathlib.PurePosixPath(path) / "report.pdf"
    # ...analyze the data, create the report and write it to `report_path`...

    return {
        "title": "Report title",
        "date": str(datetime.date.today()),
        "low": 2,
        "high": 7,
        "std_dev": 1,
        "confidence": 97,
        "report_path": str(report_path),
    }
{
  "Comment": "Generate a report and seek approval to publish it",
  "StartAt": "Generate",
  "States": {
    "Generate": {
      "Comment": "Generate the report using a Globus Compute function",
      "Type": "Action",
      "Handler": {
        "Type": "ActionProvider",
        "Url": "https://compute.actions.globus.org/v3"
      },
      "Parameters": {
        "endpoint_id": "11111111-2222-3333-4444-555555555555",
        "tasks": [
          {
            "function_id": "11111111-2222-3333-4444-555555555555",
            "kwargs": {
              "id.$": "$.location.id",
              "path.$": "$.location.path"
            }
          }
        ]
      },
      "ResultPath": "$.compute_results",
      "Next": "RehomeComputeResults"
    },
    "RehomeComputeResults": {
      "Type": "Pass",
      "InputPath": "$.compute_results.details.results[0].output",
      "ResultPath": "$.compute_results",
      "Next": "CreateWebInput"
    },
    "CreateWebInput": {
      "Type": "CreateWebInput",
      "Parameters": {
        "InputType": "Selection",
        "Context": {
          "PresentationStyle": "Table",
          "Title.=": "'Approve publication of report \"' + `$.compute_results.title` + '\"'",
          "Rows": [
            {
              "Field": "Report date",
              "Value.$": "$.compute_results.date"
            },
            {
              "Field": "Report name",
              "Value.$": "$.compute_results.title"
            },
            {
              "Field": "Result range and std dev",
              "Value.=": "'[' + str(`$.compute_results.low`) + ', ' + str(`$.compute_results.high`) + '], ' + str(`$.compute_results.std_dev`)"
            },
            {
              "Field": "Result confidence",
              "Value.$": "$.compute_results.confidence"
            }
          ]
        },
        "Options": [
          {
            "Value": "public",
            "Label": "✅ Publish",
            "Description": "Make the report public."
          },
          {
            "Value": "private",
            "Label": "❌ Store, but don't publish (default)",
            "Description": "Ingest the report, but don't make it public."
          }
        ],
        "RespondentUrns": [
          "urn:globus:group:id:11111111-2222-3333-4444-555555555555"
        ]
      },
      "ResultPath": "$.web_input_info",
      "Next": "PrepareIngestPayload"
    },
    "PrepareIngestPayload": {
      "Comment": "Prepare the Search ingest payload. `visible_to` is set to a private Globus Group and will be modified only if publication is approved.",
      "Type": "ExpressionEval",
      "Parameters": {
        "search_index": "11111111-2222-3333-4444-555555555555",
        "subject.$": "$.compute_results.title",
        "visible_to": [
          "urn:globus:group:id:11111111-2222-3333-4444-555555555555"
        ],
        "content": {
          "date.$": "$.compute_results.date",
          "collection_id.$": "$.location.id",
          "report_path.$": "$.compute_results.report_path"
        }
      },
      "ResultPath": "$.ingest_parameters",
      "Next": "AwaitResponse"
    },
    "AwaitResponse": {
      "Type": "AwaitWebInput",
      "Parameters": {
        "web_input_id.$": "$.web_input_info.web_input_id"
      },
      "ResultPath": "$.response_info",
      "Next": "EvaluateResponse",
      "Catch": [
        {
          "ErrorEquals": [
            "Flows.WebInputExpired"
          ],
          "Next": "EvaluateResponse",
          "ResultPath": "$.response_info"
        }
      ]
    },
    "EvaluateResponse": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.response_info.response",
          "StringEquals": "public",
          "Next": "MakeReportPublic"
        }
      ],
      "Default": "Ingest"
    },
    "MakeReportPublic": {
      "Comment": "Publication was approved. Update `visible_to` to 'public'; all other fields are simply copied.",
      "Type": "ExpressionEval",
      "Parameters": {
        "visible_to": [
          "public"
        ],
        "content.$": "$.ingest_parameters.content",
        "search_index.$": "$.ingest_parameters.search_index",
        "subject.$": "$.ingest_parameters.subject"
      },
      "ResultPath": "$.ingest_parameters",
      "Next": "Ingest"
    },
    "Ingest": {
      "Type": "Action",
      "Handler": {
        "Type": "ActionProvider",
        "Url": "https://actions.globus.org/search/ingest"
      },
      "InputPath": "$.ingest_parameters",
      "End": true
    }
  }
}
{
  "type": "object",
  "required": [
    "location"
  ],
  "additionalProperties": false,
  "properties": {
    "location": {
      "type": "object",
      "format": "globus-collection",
      "title": "The collection and path to the data that will be analyzed",
      "required": [
        "id",
        "path"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "title": "Source Collection ID",
          "format": "uuid",
          "description": "The UUID of the collection hosting the data to be analyzed"
        },
        "path": {
          "type": "string",
          "title": "Source Collection Path",
          "description": "The path to the data on the collection"
        }
      }
    }
  }
}
{
  "location": {
    "id": "11111111-2222-3333-4444-555555555555",
    "path": "/~/instrument-run-2026-01-01"
  }
}
  • Globus Flows
  • Overview
  • Getting Started
    • How to Run a Flow
    • How to Monitor a Flow Run
    • How to Create a Flow
    • How to Manage High Assurance Flows
  • Authoring Flows
    • Introduction
    • Actions
    • Expressions
    • Choice States
    • Wait States
    • CreateWebInput States
    • AwaitWebInput States
    • Fail States
    • Pass States
    • Protecting Secrets
    • Handling Exceptions
    • Performing Actions as Different Users
    • Run Context
    • Validating Flow Definitions
    • High Assurance Flows
  • Authoring Input Schemas
  • Registered APIs
    • Feature Overview
    • Tutorials
    • Explanations
    • How-tos
    • Reference
    • The Globus Registered API CLI
  • Web Inputs
    • Feature Overview
    • Controlling Access
    • Notifying Respondents
    • Responding
  • Authentication and Authorization
  • Consents and Resuming Runs
  • Permissions
  • Limits
  • Hosted Registered APIs
    • Usage notes
    • Globus Groups Registered APIs
    • Globus Search Registered APIs
  • Hosted Action Providers
    • Hello World
    • Globus Search - Ingest Task
    • Globus Search - Delete Task
    • Send Notification Email
    • Wait For User Selection
    • Expression Evaluation
    • DataCite Mint
    • Transfer APs
    • Compute AP
  • Example Flows
    • Simple Transfer
    • Move (copy and delete) files
    • Evaluate preliminary results
    • Transfer and Share Files
    • Approved publication
    • Two Stage Globus Transfer
    • Web Inputs: Admin signoff
    • Transfer After Approval
    • Looping Batched Move
    • Tar and Transfer for collections with an associated flow policy
    • Tar and Transfer with Globus Compute
© 2010- The University of Chicago Legal Privacy Accessibility