LogoLogo
  • 👋Welcome to Arcee AI Docs
  • Arcee Orchestra
    • Introduction to Arcee Orchestra
    • Getting Started
    • Workflows
      • Workflow Components
        • Model Node
        • Code Node
        • Integrations
        • Knowledge Retrieval
        • Conditional Node
      • Passing Variables
      • API Invocation
        • List Available Workflows API
        • Workflow Execution API
        • Workflow Execution Steps API
        • Execution History API
        • Workflow Diagram API
        • API Code Examples
        • Upload Workflow JSON API
        • Workflow Runs API
    • Workflow Library
      • Research Automation
      • Real Time Financial Analysis
      • Blog Writer
      • Code Improvement
      • Energy Domain Assistant
    • Chat Interface
    • FAQ
  • ARCEE CONDUCTOR
    • Introduction to Arcee Conductor
    • Getting Started
    • Features & Functionality
      • Auto Mode
      • Auto Reasoning Mode
      • Auto Tools Mode
      • Compare
      • Direct Model Invocation
      • Usage
      • API
    • Arcee Small Language Models
      • Model Selection
      • Model Performance
    • Pricing
Powered by GitBook
On this page
  1. Arcee Orchestra
  2. Workflows
  3. API Invocation

Upload Workflow JSON API

Upload workflow JSON definition programatically

PreviousAPI Code ExamplesNextWorkflow Runs API

Last updated 21 days ago

You can Download Workflow JSON in the workflow builder.

You can edit the JSON programmatically and re-upload it with to following API route. Note: it is best practice to edit an existing workflow structure to preserve node layout and positioning.

You can optional upload to a new workflow, or update an existing workflow by including workflow_id in the post data.

import json
import requests
import json
import os
from pathlib import Path

with open("YourJson.json", "r") as f:
    workflow_json = json.load(f)

workflow_json_str = json.dumps(workflow_json)

url = f"{API_BASE_URL}/workflows/upload"
headers = {"Authorization": f"Bearer {API_KEY}"}

# Create files dictionary with the JSON content
files = {
    'workflow_file': ('YourJson.json', workflow_json_str.encode('utf-8'), 'application/json')
}

# Make the request
response = requests.post(
    url,
    headers=headers,
    files=files,
)

# # optionally include workflow_id to update an existing workflow
# # data = {
# #     "workflow_id" : "THE_WORKFLOW_ID"
# # }

# # # Make the request
# # response = requests.post(
# #     url,
# #     data,
# #     headers=headers,
# #     files=files,
# # )

# Print the results
print(f"Status code: {response.status_code}")
print(f"Response: {response.json() if response.status_code == 200 else response.text}")
Download workflow JSON in the workflow builder