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
  • List Available Workflows
  • Workflow Execution
  • Workflow Execution Steps
  • Execution History
  • Workflow Diagram
  1. Arcee Orchestra
  2. Workflows
  3. API Invocation

API Code Examples

This page provides code examples for running the APIs in Python.

Before running any of the scripts, run export ARCEE_API_TOKEN=$YOUR_TOKEN.

List Available Workflows

import requests
import os

# Setup
API_BASE_URL = "https://orchestra.arcee.ai/api/v1/workflow"
API_KEY = os.environ.get("ARCEE_API_TOKEN")
headers = {"Authorization": f"Bearer {API_KEY}"}

# List workflows
response = requests.get(f"{API_BASE_URL}/workflows", headers=headers)
print(response.json())

Workflow Execution

import requests
import os

# Setup
API_BASE_URL = "https://orchestra.arcee.ai/api/v1/workflow"
API_KEY = os.environ.get("ARCEE_API_TOKEN")
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
workflow_id = "YOUR_WORKFLOW_ID"

# Execute a workflow
payload = {"prompt": "Tell me a joke about the weather"}
response = requests.post(f"{API_BASE_URL}/workflows/{workflow_id}/execute", 
                        headers=headers, 
                        json=payload)

print(response.json())

Workflow Execution Steps

import requests
import os

# Setup
API_BASE_URL = "https://orchestra.arcee.ai/api/v1/workflow"
API_KEY = os.environ.get("ARCEE_API_TOKEN")
headers = {"Authorization": f"Bearer {API_KEY}"}
workflow_id = "YOUR_WORKFLOW_ID"
run_id = "YOUR_RUN_ID"

# Get workflow execution steps
response = requests.get(f"{API_BASE_URL}/workflows/{workflow_id}/runs/{run_id}/steps", headers=headers)
run_details = response.json()
print(run_details)

Execution History

import requests
import os

# Setup
API_BASE_URL = "https://orchestra.arcee.ai/api/v1/workflow"
API_KEY = os.environ.get("ARCEE_API_TOKEN")
headers = {"Authorization": f"Bearer {API_KEY}"}
workflow_id = "YOUR_WORKFLOW_ID"
limit = 10
offset = 0

# Get execution history
response = requests.get(f"{API_BASE_URL}/workflows/{workflow_id}/runs?limit={limit}&offset={offset}", headers=headers)
print(response.json())

Workflow Diagram

import requests
import os

# Setup
API_BASE_URL = "https://orchestra.arcee.ai/api/v1/workflow"
API_KEY = os.environ.get("ARCEE_API_TOKEN")
headers = {"Authorization": f"Bearer {API_KEY}"}
workflow_id = "YOUR_WORKFLOW_ID"

# Get workflow diagram
response = requests.get(f"{API_BASE_URL}/workflows/{workflow_id}/diagram", headers=headers)
print(response.json())
PreviousWorkflow Diagram APINextUpload Workflow JSON API

Last updated 1 month ago

Page cover image