Workflow (Legacy)

Overview (Legacy)

This is the legacy Workflow API. For new integrations, use the Workflow API (JSON-based, /v2/workflow).

The legacy API enables you to create sophisticated video transformations by applying multi-step processing pipelines to your images. Workflows automate complex video production tasks through predefined templates that handle multiple processing steps automatically.

How Workflows Work

  1. Upload Images - Provide one or more images as input
  2. Select Template - Choose a workflow template that defines the processing steps
  3. Configure Options - Customize template-specific options (backgrounds, prompts, motion types)
  4. Process - The workflow automatically executes all steps in sequence
  5. Get Results - Retrieve the final processed video and intermediate step results

Templates in use

Template ID Label Description Inputs Options
vim_new_year_2026 New Year 2026 Place a person/perople into a festive new year celebration! camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_dancing_santa Dancing Santa Transform a person into a Santa and make him/her dance wi... camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_birthday Birthday Transform your family photo into a birthday party scene! camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_instagramframeescape_0226 Instagram Frame Escape Transform a person into an Instagram-style frame escape s... camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "user_name": "\u2014", "job_description": "businessman"}
vim_dreamcareer_0226 Dream Career Transform a person into his/her dream career scene with c... camera, local; provide image_urls in request body {"image_description": "\u2014", "aspect_ratio": "16:9"}
vim_ces_show CES Show Transform a person/people into CES photobooth shot. camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_amazonia Amazonia Transform a person/people into an Amazonia jungle scene. camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_arctic Arctic Transform a person/people into an Arctic snow scene. camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_sketch_me Sketch Me Sketch a person/people from a photo into pencil drawing. camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_product_showcase Product Showcase Have a product standing out with a smart photo-shot setti... local, asset; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
each_explodedloop_0226 Exploded Loop Have a product exploded into layers with labels then loop... Template-specific (see options); provide image_urls or option-specific fields {"prompt": "\u2014", "aspect_ratio": "9:16"}
each_ugcproduct_0226 UGC Product Create a UGC video of a product with crafted marketing me... Template-specific (see options); provide image_urls or option-specific fields {"product_name": "Premium Skincare Serum", "target_audience": "Women aged 25-40 interested in anti-aging skincare", "product_image": "https://distribution.vimmerse.net/presets/image/skincare_product.jpg", "voice": "Sarah", "aspect_ratio": "9:16"}

Workflow Processing Steps

Each template follows a specific processing pipeline that may include:

  • Content cropping and alpha channel replacement
  • Image-to-image transformation
  • Background replacement
  • Face swapping
  • Video animation creation
  • Upscaling and enhancement
  • Video composition

Quick Start Example

import requests
import json
import time

BASE_URL = "https://api.vimmerse.net"
API_KEY = "YOUR_API_KEY"

# Step 1: Create workflow
url = f"{BASE_URL}/workflow"
headers = {"X-Api-Key": API_KEY}

# Prepare options for vim_new_year_2026
options = {
    "aspect_ratio": "16:9",
    "pipeline_mode": "video"
}

payload = {
    "title": "My Workflow Video",
    "description": "Animated overlay video",
    "template_id": "vim_new_year_2026",
    "options": json.dumps(options),
    "visibility_status": "1",
    "image_urls": ["https://example.com/image.png"]
}

try:
    response = requests.post(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    workflow_data = result["data"]
    workflow_id = workflow_data["id"]

    print(f"✓ Workflow created! ID: {workflow_id}")
    print(f"  Status: {workflow_data['processing_status']}")

except requests.exceptions.RequestException as e:
    print(f"✗ Error creating workflow: {e}")
    exit(1)

# Step 2: Poll for completion
print("\nPolling for workflow completion...")
max_attempts = 120  # Maximum 60 minutes
attempt = 0
poll_interval = 30  # Check every 30 seconds

def get_workflow_status(workflow_id):
    """Retrieve the current status of a workflow."""
    url = f"{BASE_URL}/workflow/{workflow_id}"
    headers = {"X-Api-Key": API_KEY}

    try:
        response = requests.get(url, headers=headers, timeout=30)
        response.raise_for_status()
        return response.json()["data"]
    except requests.exceptions.RequestException as e:
        print(f"  Warning: Error retrieving status: {e}")
        return None

while attempt < max_attempts:
    workflow_data = get_workflow_status(workflow_id)

    if not workflow_data:
        print(f"  Attempt {attempt + 1}/{max_attempts}: Failed to retrieve status, retrying...")
        time.sleep(poll_interval)
        attempt += 1
        continue

    status = workflow_data.get("processing_status")
    progress = workflow_data.get("progress_percentage", 0)

    print(f"  Attempt {attempt + 1}/{max_attempts}: Status={status}, Progress={progress}%")

    if status == "success":
        results = workflow_data.get("result", [])
        if results:
            print(f"\n✓ Workflow completed successfully!")
            for result_item in results:
                video_url = result_item.get("url")
                content_type = result_item.get("content_type")
                print(f"  Result: {content_type} - {video_url}")
        break
    elif status == "fail":
        print(f"\n✗ Workflow processing failed.")
        print(f"  Workflow ID: {workflow_id}")
        exit(1)

    time.sleep(poll_interval)
    attempt += 1

if attempt >= max_attempts:
    print(f"\n⚠ Timeout: Workflow processing is taking longer than expected.")
    print(f"  Workflow ID: {workflow_id}")
    print(f"  Please check the status later using: GET {BASE_URL}/workflow/{workflow_id}")

Webhook Integration

Instead of polling, you can configure a webhook URL to receive notifications when workflow processing completes.

Setting Up Webhooks

Include the webhook_url parameter when creating a workflow (if supported by the template):

payload = {
    "template_id": "vim_new_year_2026",
    "options": json.dumps(options),
    "webhook_url": "https://your-domain.com/api/webhooks/workflow-complete",
    # ... other parameters
}

Note: Webhook support varies by template. Check template-specific documentation for webhook availability.

Overview (Legacy)

This is the legacy Workflow API. For new integrations, use the Workflow API (JSON-based, /v2/workflow).

The legacy API enables you to create sophisticated video transformations by applying multi-step processing pipelines to your images. Workflows automate complex video production tasks through predefined templates that handle multiple processing steps automatically.

How Workflows Work

  1. Upload Images - Provide one or more images as input
  2. Select Template - Choose a workflow template that defines the processing steps
  3. Configure Options - Customize template-specific options (backgrounds, prompts, motion types)
  4. Process - The workflow automatically executes all steps in sequence
  5. Get Results - Retrieve the final processed video and intermediate step results

Templates in use

Template ID Label Description Inputs Options
vim_new_year_2026 New Year 2026 Place a person/perople into a festive new year celebration! camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_dancing_santa Dancing Santa Transform a person into a Santa and make him/her dance wi... camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_birthday Birthday Transform your family photo into a birthday party scene! camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_instagramframeescape_0226 Instagram Frame Escape Transform a person into an Instagram-style frame escape s... camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "user_name": "\u2014", "job_description": "businessman"}
vim_dreamcareer_0226 Dream Career Transform a person into his/her dream career scene with c... camera, local; provide image_urls in request body {"image_description": "\u2014", "aspect_ratio": "16:9"}
vim_ces_show CES Show Transform a person/people into CES photobooth shot. camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_amazonia Amazonia Transform a person/people into an Amazonia jungle scene. camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_arctic Arctic Transform a person/people into an Arctic snow scene. camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_sketch_me Sketch Me Sketch a person/people from a photo into pencil drawing. camera, local; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
vim_product_showcase Product Showcase Have a product standing out with a smart photo-shot setti... local, asset; provide image_urls in request body {"aspect_ratio": "16:9", "pipeline_mode": "image"}
each_explodedloop_0226 Exploded Loop Have a product exploded into layers with labels then loop... Template-specific (see options); provide image_urls or option-specific fields {"prompt": "\u2014", "aspect_ratio": "9:16"}
each_ugcproduct_0226 UGC Product Create a UGC video of a product with crafted marketing me... Template-specific (see options); provide image_urls or option-specific fields {"product_name": "Premium Skincare Serum", "target_audience": "Women aged 25-40 interested in anti-aging skincare", "product_image": "https://distribution.vimmerse.net/presets/image/skincare_product.jpg", "voice": "Sarah", "aspect_ratio": "9:16"}

Workflow Processing Steps

Each template follows a specific processing pipeline that may include:

  • Content cropping and alpha channel replacement
  • Image-to-image transformation
  • Background replacement
  • Face swapping
  • Video animation creation
  • Upscaling and enhancement
  • Video composition

Quick Start Example

import requests
import json
import time

BASE_URL = "https://api.vimmerse.net"
API_KEY = "YOUR_API_KEY"

# Step 1: Create workflow
url = f"{BASE_URL}/workflow"
headers = {"X-Api-Key": API_KEY}

# Prepare options for vim_new_year_2026
options = {
    "aspect_ratio": "16:9",
    "pipeline_mode": "video"
}

payload = {
    "title": "My Workflow Video",
    "description": "Animated overlay video",
    "template_id": "vim_new_year_2026",
    "options": json.dumps(options),
    "visibility_status": "1",
    "image_urls": ["https://example.com/image.png"]
}

try:
    response = requests.post(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    workflow_data = result["data"]
    workflow_id = workflow_data["id"]

    print(f"✓ Workflow created! ID: {workflow_id}")
    print(f"  Status: {workflow_data['processing_status']}")

except requests.exceptions.RequestException as e:
    print(f"✗ Error creating workflow: {e}")
    exit(1)

# Step 2: Poll for completion
print("\nPolling for workflow completion...")
max_attempts = 120  # Maximum 60 minutes
attempt = 0
poll_interval = 30  # Check every 30 seconds

def get_workflow_status(workflow_id):
    """Retrieve the current status of a workflow."""
    url = f"{BASE_URL}/workflow/{workflow_id}"
    headers = {"X-Api-Key": API_KEY}

    try:
        response = requests.get(url, headers=headers, timeout=30)
        response.raise_for_status()
        return response.json()["data"]
    except requests.exceptions.RequestException as e:
        print(f"  Warning: Error retrieving status: {e}")
        return None

while attempt < max_attempts:
    workflow_data = get_workflow_status(workflow_id)

    if not workflow_data:
        print(f"  Attempt {attempt + 1}/{max_attempts}: Failed to retrieve status, retrying...")
        time.sleep(poll_interval)
        attempt += 1
        continue

    status = workflow_data.get("processing_status")
    progress = workflow_data.get("progress_percentage", 0)

    print(f"  Attempt {attempt + 1}/{max_attempts}: Status={status}, Progress={progress}%")

    if status == "success":
        results = workflow_data.get("result", [])
        if results:
            print(f"\n✓ Workflow completed successfully!")
            for result_item in results:
                video_url = result_item.get("url")
                content_type = result_item.get("content_type")
                print(f"  Result: {content_type} - {video_url}")
        break
    elif status == "fail":
        print(f"\n✗ Workflow processing failed.")
        print(f"  Workflow ID: {workflow_id}")
        exit(1)

    time.sleep(poll_interval)
    attempt += 1

if attempt >= max_attempts:
    print(f"\n⚠ Timeout: Workflow processing is taking longer than expected.")
    print(f"  Workflow ID: {workflow_id}")
    print(f"  Please check the status later using: GET {BASE_URL}/workflow/{workflow_id}")

Webhook Integration

Instead of polling, you can configure a webhook URL to receive notifications when workflow processing completes.

Setting Up Webhooks

Include the webhook_url parameter when creating a workflow (if supported by the template):

payload = {
    "template_id": "vim_new_year_2026",
    "options": json.dumps(options),
    "webhook_url": "https://your-domain.com/api/webhooks/workflow-complete",
    # ... other parameters
}

Note: Webhook support varies by template. Check template-specific documentation for webhook availability.

Create Workflow

SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
title
string (Title)
Default: ""
description
string (Description)
Default: ""
visibility_status
string (Visibility Status)
Default: "1"

Visibility Status:

Value Status
"0" Private
"1" Unlisted
"2" Public
image_files
Array of strings <binary> (Image Files)
Default: []

Images to upload. ...

image_urls
Array of strings (Image URLs)
Default: []

If you upload image files, this field will be ignored.

template_id
string (Template ID)
Default: "vim_new_year_2026"

Template ID of the workflow. ...

options
string (Options)
Default: "{}"

Json string of options

event_id
string (Event ID)
Default: "no_event"

Event ID of the workflow. ..

Responses
200

New Media

402

Insufficient Credit

404

Not Found

422

Validation Error

post/workflow
Request samples
Response samples
application/json
{}

Get Workflow Status

SecurityAPIKeyHeader
Responses
200

Workflow Object

404

Not Found

422

Validation Error

get/workflow/{workflow_id}
Request samples
Response samples
application/json
{}

Update Workflow

Update a workflow. You can update one or more of the following fields:

  • title: Workflow title
  • description: Workflow description
  • visibility_status: Visibility status ("0" for private, "1" for unlisted, "2" for public)
  • rating: Rating value (string)
  • delivered_at: Timestamp for when workflow was delivered (if None or not provided, current timestamp will be used when setting delivered_at)
SecurityAPIKeyHeader
Request
Request Body schema: application/json
required
property name*
additional property
any
Responses
200

Updated Workflow Object

400

Bad Request

404

Not Found

422

Validation Error

put/workflow/{workflow_id}
Request samples
Response samples
application/json
{}

Delete Workflow

Delete a workflow and its associated S3 files.

SecurityAPIKeyHeader
Responses
200

Deleted Workflow Object

404

Not Found

422

Validation Error

delete/workflow/{workflow_id}
Request samples
Response samples
application/json
{}

Log Customer Script Error

Log customer script errors to S3. Errors are organized by customer_id and weekly period. Logs reset every week, with all errors for a week stored in a single file.

Request body should contain:

  • error_message (required): Error message from customer script
  • context (optional): Additional context information (e.g., workflow_id, script_name, etc.)
SecurityAPIKeyHeader
Request
Request Body schema: application/json
required
property name*
additional property
any
Responses
200

Error logged successfully

400

Bad Request

422

Validation Error

post/workflow/error-log
Request samples
Response samples
application/json
{}