How to create a workflow?
Overview
After adding a connector, you might want to create a workflow. This can be done in two ways:
- Via the UniteLabs platform UI: Use the visual workflow builder to define your flow, including parameters and logic.
- Via the API: Programmatically create a workflow by submitting a payload with the required parameters, structure, and triggers.
Introduction: Unlock the Power of Python Workflows
This guide will show you how to quickly test your Python workflows using our online editor, and then seamlessly transition to a robust local development and deployment setup on our platform.
- Why use Workflows?
Our Workflows platform provides reliability, observability, and scalability for all your automation needs. - Who is this for?
This guide is for data engineers, data scientists, and developers looking to orchestrate and manage Python code. Please select the desired option to see how to create a flow:
Refer to the general section for an overview of the workflow UI.
Step-by-Step: Create a Workflow via the Web-App
Follow these steps to define a workflow using the UniteLabs platform UI. Access our intuitive online editor directly in your browser. The simple user interface features a code editor where you can write your Python workflows and an output/logs pane to see immediate results.
- Navigate to the Workflows Section
Go to the 'Workflows' tab from the platform navigation menu. - Click on "Create"
Start a new workflow using the "Create" button. - Define Workflow Metadata
Provide the essential metadata that describes your workflow. These fields help you organize & identify your workflows.
name
: A required field. The human-readable name of your workflow.tags
: Optional. Keywords for categorization or filtering. Hit enter to add a new tag.description
: Optional. A longer explanation of what your workflow does.files
: Optional. Upload a.zip
archive containing Python source files to include in the workflow logic.
- Add Workflow Logic to your first workflow
Use the visual editor or code interface to add logic blocks, data operations, or Python scripts:
Let's start with a simple example. Copy and paste the following Python code into the online editor:from your_workflow_sdk import task, flow @task def say_hello(name: str): print(f"Hello, {name}!") return f"Hello, {name}!" @task def say_goodbye(name: str): print(f"Goodbye, {name}!") return f"Goodbye, {name}!" @flow(name="My First Online Workflow") def simple_greeting_flow(person_name: str = "World"): hello_message = say_hello(person_name) goodbye_message = say_goodbye(person_name) print(f"Flow completed with messages: {hello_message}, {goodbye_message}") if __name__ == "__main__": simple_greeting_flow(person_name="Online User")
- Run the flow
See the "How to trigger workflows" guide for a comprehensive overview on how your created workflow could be run.
Feel free to modify the code, change the input, or add new tasks. The online editor provides immediate feedback, making it an excellent environment for quick testing and learning core workflow concepts.
Note:
The online editor is designed for rapid prototyping. It doesn't support creating advanced project structures. For those capabilities, you'll want to move to local development.
Conclusion: Your Workflow Journey
You've now learned how to leverage both the rapid prototyping capabilities of our online editor and the robust, version-controlled development workflow using Git and your local IDE. By combining these approaches, you can efficiently build, test, and deploy powerful Python workflows to our Workflows platform.
Ready to build powerful lab automation? Start deploying your Python Workflows today!