Check out this Github Repository for a quick overview on how to build an Elemental Flow.
This guide explains how to create, test, and deploy elemental flows that implement focused, single-task processing. Elemental flows provide core functionality that can be used independently or as building blocks within compound flows. ππ‘
# Version format ex. "0.0.1"version: "your.version.here" # Flow specification version# Basic metadata for the agentmetadata: name: "your-flow-name" # Unique identifier description: "A brief description of your flow" # Flow purpose author: "your-username" # Must match your account username tags: [tag1, tag2, tag3, ...] # Keywords for categorization private: false # Access control setting# Define the input variables requiredinputs: input1: # First input parameter type: string # Currently only String format description: "Description of input1" required: true example: "Example value for input1" input2: # Second input parameter type: string description: "Description of input2" required: true example: "Example value for input2"# LLM configurationmodel: provider: "provider-name" # e.g., anthropic, openai, meta, etc. name: "model-name" # Specific model identifier# Dataset configuration (Optional)dataset: source: "author_name/dataset_name" # Make sure this dataset exists# Prompt template configurationprompt: | Your flow's primary instruction or role... You can use {input1} and {input2} placeholders to reference inputs.# ReadME configurationreadme: | Your flow's readme... You can use raw text or markdown here.
from mira_sdk import MiraClient, Flowclient = MiraClient(config={"API_KEY": "YOUR_API_KEY"}) # Initialize clientversion = "1.0.0" # Optional specific versioninput_data = {"key": "value"} # Execution input# If no version is provided, it'll use the latest version by defaultif version: flow_name = f"author/your-flow-name/{version}"else: flow_name = "author/your-flow-name"result = client.flow.execute(flow_name, input_data) # Execute flowprint(result)
from mira_sdk import Flow, MiraClientfrom mira_sdk.exceptions import FlowErrorclient = MiraClient(config={"API_KEY": "YOUR_API_KEY"}) # Initialize client# Load existing flowflow = client.flow.get("author/flow_name") # Get current versionflow.save("/path/to/flow.yaml") # Save for editing# Deploy updated flowtry: client.flow.deploy(flow) # Deploy new versionexcept FlowError as e: print(f"Error occurred: {str(e)}") # Handle update error# In case you forget to bump the flow version, it will get bumped by default every time you deploy the same flow.
By following these steps, you can create, test, deploy, and manage your own custom elemental flows on the Mira Flows platform. This process allows you to contribute to the Marketplace and continuously improve your flows over time. ππ§