Last updated

Shuffll Workflow Overview

Shuffll enables seamless AI-powered video creation, allowing businesses and developers to generate, enhance, and export videos automatically.


Integration Options

You can integrate Shuffll in two ways:

1️⃣ Shuffll API – For full programmatic control over the video creation process.
2️⃣ Shuffll iFrame – Embed Shuffll’s project creation wizard directly into your application.


API Approaches

For API users, there are two different approaches depending on how much control you need:

πŸ”Ή 1. Full Sequence: Step-by-Step Control

Use separate API calls for each stage:

  • Create Project β†’ Monitor Status β†’ Enhance β†’ Export β†’ Retrieve URL
  • Ideal for applications requiring custom processing, additional editing, or detailed progress tracking.

πŸ”Ή 2. AutoEnhance + AutoExport with Webhooks: Full Automation

Use a single API call to create a project and let Shuffll handle everything else automatically.

  • AutoEnhance applies branding, effects, subtitles, and post-production automatically.
  • AutoExport finalizes and delivers a ready-to-publish video.
  • Webhooks notify you when each stage is completedβ€”no need for polling.
  • Ideal for high-volume automation and reducing API calls.

Polling vs Webhook Flowchart

Shuffll provides two ways to automate video creation:

1️⃣ Polling-Based Workflow – Requires multiple API calls to check status at each stage.
2️⃣ Webhook-Based Workflow – Uses event-driven automation to reduce API calls and fully automate the process.\

Shuffll Workflow


πŸ› οΈ Polling Workflow

  1. Create Project β†’ Call POST /project/create
  2. Check Status β†’ Poll GET /project/{projectId}/status
  3. Enhance Video β†’ Call POST /project/{projectId}/enhance
  4. Check Enhancement Status β†’ Poll GET /project/{projectId}/enhance/status
  5. Export Video β†’ Call POST /project/{projectId}/export
  6. Check Export Status β†’ Poll GET /project/{projectId}/export/status
  7. Retrieve Final Video URL

πŸ”Ή More API calls but granular control over each phase.


Webhook-Based Workflow (AutoEnhance + AutoExport)

  1. Create Project β†’ Call POST /project/create
  2. Webhook Notifies Enhancement is Complete
  3. Webhook Notifies Export is Complete
  4. Retrieve Final Video URL

πŸ”Ή Fewer API calls and fully automated with webhooks.


When to Use Polling vs. Webhooks?

FeaturePolling WorkflowWebhook Workflow
Granular Controlβœ… Yes❌ No
Minimizes API Calls❌ Noβœ… Yes
Real-Time Status Checkingβœ… Yes❌ No
Ideal for Large-Scale Automation❌ Noβœ… Yes
Requires Webhook Support❌ Noβœ… Yes

Choose Polling if you need full control, custom logic, or manual intervention.
Choose Webhooks if you want hands-free, fully automated video creation.


The Full Video Creation Process

Shuffll follows a structured workflow with the following steps:

1️⃣ Project Creation – Define the idea, create a script, and structure a storyline.
2️⃣ Video Generation – Turn the storyline into a full video using AI-driven media creation.
3️⃣ Enhancement & Post-Production – Add branding, animations, subtitles, and optimize audio.
4️⃣ Export & Publishing – Finalize and distribute the polished video.


iFrame vs. API: Which One to Choose?

FeatureAPI IntegrationiFrame Integration
CustomizationFull control over every stepPre-built, ready-to-use UI
Ease of UseRequires API developmentNo-code, easy embedding
AutomationCan be manual or automatedFully guided video creation
Best ForDevelopers & advanced automationPlatforms wanting to offer video creation as a service

Webhook Handling Example

Example: Handling a Webhook Notification (Node.js)

const express = require("express");
const app = express();
app.use(express.json());

app.post("/webhook", (req, res) => {
    const { event, projectId, videoUrl } = req.body;
    
    if (event === "video_ready") {
        console.log(`Video is ready: ${videoUrl}`);
    }
    
    res.status(200).send("Webhook received");
});

app.listen(3000, () => console.log("Webhook server running on port 3000"));

This example listens for webhooks and logs when a video is ready.


Full API Workflow Example (AutoEnhance + AutoExport)

Example: Creating a Video with Webhooks, AutoEnhance and AutoExport (Node.js)

# Step 1: Create a Project with AutoEnhance & AutoExport
curl -X POST "https://dapi.shuffllmedia.com/api/v1/project/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "How AI is revolutionizing marketing",
    "templateId": "123456",
    "videoTagId": "Marketing",
    "autoEnhance": true,
    "autoExport": true,
    "webhookUrl": "https://yourserver.com/webhook"
  }'

# Step 2: Wait for Webhook Notifications (Your server automatically receives updates)
# Step 3: Retrieve Final Video URL from Webhook Response

This example creates a project with AutoEnhance and AutoExport, and then waits for webhooks to notify you when the video is ready.


Troubleshooting

Webhook Not Triggering? πŸ”Ή Ensure the webhook URL is publicly accessible. πŸ”Ή Check firewall rules that might block incoming requests.

Polling Causing Rate Limits? πŸ”Ή Implement exponential backoff (wait longer between requests). πŸ”Ή Consider switching to webhooks for automation.

iFrame Not Loading? πŸ”Ή Ensure your embedding domain is whitelisted.


Next Steps

API Integration – Learn how to implement the API step by step. iFrame Integration – Learn how to embed Shuffll’s project creation wizard in your app. Webhook Guide – Set up automation without polling.

Ready to start? Let’s create your first video!

Create Your First Video β†’


Final Enhancements

βœ” Single-file format for easy access.
βœ” Polling vs. Webhooks Flowchart included.
βœ” iFrame vs. API Table for clear decision-making.
βœ” Webhook Example (Node.js) for event-driven automation.
βœ” Full API Workflow Example (cURL) for automation.
βœ” Troubleshooting Section to solve common issues.