The Workflow 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.
overlay_gray_5443 (Recommended)
overlay_gray_5442
overlay_only_1025
vim_new_year_2026 - Transforms person into astronaut in microgravity scene vim_dancing_santa - Creates space jump scene with astronaut suit transformation vim_birthday - Simulates moonwalk on lunar surface with astronaut suit vim_instagramframeescape_0226 - Ceremonial flag planting on lunar surface vim_dreamcareer_0226 - Career transformation scenes vim_ces_show - Trade show presentations vim_amazonia - Nature and adventure scenes vim_arctic - Arctic exploration themes vim_sketch_me - Artistic sketch transformations vim_product_showcase - Product demonstration videos each_explodedloop_0226 - Exploded view animations each_ugcproduct_0226 - User-generated content product videos
Each template follows a specific processing pipeline that may include:
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 overlay video template
options = {
"background_urls": "https://example.com/background1.mp4,https://example.com/background2.mp4",
"prompt": "Person is joyfully smiling and walking backward while still looking forward.",
"motion_type": "Auto"
}
payload = {
"title": "My Workflow Video",
"description": "Animated overlay video",
"template_id": "overlay_gray_5443",
"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}")
Instead of polling, you can configure a webhook URL to receive notifications when workflow processing completes.
Include the webhook_url parameter when creating a workflow (if supported by the template):
payload = {
"template_id": "overlay_gray_5443",
"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.
New Media
Insufficient Credit
Not Found
Validation Error
{- "data": {
- "id": "workflow-id-12345",
- "title": "My Animated Video",
- "description": "Animated overlay video with background",
- "visibility_status": "1",
- "model": "overlay_gray_5443",
- "options": {
- "prompt": "Person is joyfully smiling and walking backward",
- "motion_type": "Auto",
- "duration": 5,
- "last_frame_support": true
}, - "primary_user_id": "user@example.com",
- "customer_id": "customer-id",
- "processing_status": "success",
- "progress_percentage": 100,
- "completions": [
- {
- "result": [
], - "flow": "crop_to_content"
}, - {
- "result": [
], - "flow": "replace_alpha_with_gray"
}, - {
- "result": [
], - "flow": "upscale"
}, - {
- "result": [
], - "flow": "create_media"
}, - {
- "result": [
], - "flow": "video_overlay"
}
], - "result": [
], - "media_result": [
- {
- "updated_at": "2025-04-11 18:42:51+00:00",
- "size": 411634,
}
], - "created_at": "2025-04-11 18:33:59.780864+00:00",
- "updated_at": "2025-04-11 18:43:47.510893+00:00"
}
}Workflow Object
Not Found
Validation Error
{- "data": {
- "id": "workflow-id-12345",
- "title": "My Animated Video",
- "description": "Animated overlay video with background",
- "visibility_status": "1",
- "model": "overlay_gray_5443",
- "options": {
- "prompt": "Person is joyfully smiling and walking backward",
- "motion_type": "Auto",
- "duration": 5,
- "last_frame_support": true
}, - "primary_user_id": "user@example.com",
- "customer_id": "customer-id",
- "processing_status": "success",
- "progress_percentage": 100,
- "completions": [
- {
- "result": [
], - "flow": "crop_to_content"
}, - {
- "result": [
], - "flow": "replace_alpha_with_gray"
}, - {
- "result": [
], - "flow": "upscale"
}, - {
- "result": [
], - "flow": "create_media"
}, - {
- "result": [
], - "flow": "video_overlay"
}
], - "result": [
], - "media_result": [
- {
- "updated_at": "2025-04-11 18:42:51+00:00",
- "size": 411634,
}
], - "created_at": "2025-04-11 18:33:59.780864+00:00",
- "updated_at": "2025-04-11 18:43:47.510893+00:00"
}
}Update a workflow. You can update one or more of the following fields:
Updated Workflow Object
Bad Request
Not Found
Validation Error
{- "data": {
- "id": "workflow-id-12345",
- "title": "My Animated Video",
- "description": "Animated overlay video with background",
- "visibility_status": "1",
- "model": "overlay_gray_5443",
- "options": {
- "prompt": "Person is joyfully smiling and walking backward",
- "motion_type": "Auto",
- "duration": 5,
- "last_frame_support": true
}, - "primary_user_id": "user@example.com",
- "customer_id": "customer-id",
- "processing_status": "success",
- "progress_percentage": 100,
- "completions": [
- {
- "result": [
], - "flow": "crop_to_content"
}, - {
- "result": [
], - "flow": "replace_alpha_with_gray"
}, - {
- "result": [
], - "flow": "upscale"
}, - {
- "result": [
], - "flow": "create_media"
}, - {
- "result": [
], - "flow": "video_overlay"
}
], - "result": [
], - "media_result": [
- {
- "updated_at": "2025-04-11 18:42:51+00:00",
- "size": 411634,
}
], - "created_at": "2025-04-11 18:33:59.780864+00:00",
- "updated_at": "2025-04-11 18:43:47.510893+00:00"
}
}Delete a workflow and its associated S3 files.
Deleted Workflow Object
Not Found
Validation Error
{- "data": {
- "id": "workflow-id-12345",
- "title": "My Animated Video",
- "description": "Animated overlay video with background",
- "visibility_status": "1",
- "model": "overlay_gray_5443",
- "options": {
- "prompt": "Person is joyfully smiling and walking backward",
- "motion_type": "Auto",
- "duration": 5,
- "last_frame_support": true
}, - "primary_user_id": "user@example.com",
- "customer_id": "customer-id",
- "processing_status": "success",
- "progress_percentage": 100,
- "completions": [
- {
- "result": [
], - "flow": "crop_to_content"
}, - {
- "result": [
], - "flow": "replace_alpha_with_gray"
}, - {
- "result": [
], - "flow": "upscale"
}, - {
- "result": [
], - "flow": "create_media"
}, - {
- "result": [
], - "flow": "video_overlay"
}
], - "result": [
], - "media_result": [
- {
- "updated_at": "2025-04-11 18:42:51+00:00",
- "size": 411634,
}
], - "created_at": "2025-04-11 18:33:59.780864+00:00",
- "updated_at": "2025-04-11 18:43:47.510893+00:00"
}
}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 logged successfully
Bad Request
Validation Error
{- "data": {
- "message": "Error logged successfully",
- "log_path": "customer-error-logs/customer_id/errors-2024-W15.log",
}
}