{
  "version": "1.0.0",
  "id": "cmevau0rg3c44fs101lsng29a",
  "name": "GIF to MP4 Agent",
  "components": [
    {
      "id": "CMEVAVJ01FNJ",
      "name": "APIEndpoint",
      "outputs": [
        { "name": "headers", "color": "#3C89F9", "index": 0, "default": true },
        { "name": "body", "color": "#3C89F9", "index": 1, "default": true },
        { "name": "query", "color": "#3C89F9", "index": 2, "default": true },
        {
          "name": "file",
          "color": "#3C89F9",
          "expression": "body.file",
          "index": 3,
          "default": false
        },
        {
          "name": "upload_url",
          "color": "#3C89F9",
          "expression": "body.upload_url",
          "index": 4,
          "default": false
        }
      ],
      "inputs": [
        {
          "name": "file",
          "type": "Binary",
          "friendlyInputType": "Others",
          "coreInputType": "Binary",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        },
        {
          "name": "upload_url",
          "type": "Text",
          "friendlyInputType": "Text",
          "coreInputType": "Any",
          "color": "#F35063",
          "optional": false,
          "description": "upload.url received from \"get upload url\" tool",
          "index": 1,
          "default": false
        }
      ],
      "data": {
        "method": "POST",
        "endpoint": "upload_file",
        "endpointLabel": "upload_file",
        "description": "",
        "ai_exposed": true,
        "summary": "",
        "advancedModeEnabled": false
      },
      "top": "589.89px",
      "left": "84.0988px",
      "width": "",
      "height": "",
      "displayName": "APIEndpoint",
      "title": "upload file",
      "aiTitle": "",
      "description": "This endpoint is used to upload a file to the server."
    },
    {
      "id": "MEVAWZ5MIST",
      "name": "APIEndpoint",
      "outputs": [
        { "name": "headers", "color": "#3C89F9", "index": 0, "default": true },
        { "name": "body", "color": "#3C89F9", "index": 1, "default": true },
        { "name": "query", "color": "#3C89F9", "index": 2, "default": true },
        {
          "name": "filename",
          "color": "#3C89F9",
          "expression": "body.filename",
          "index": 3,
          "default": false
        }
      ],
      "inputs": [
        {
          "name": "filename",
          "type": "Text",
          "friendlyInputType": "Text",
          "coreInputType": "Binary",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        }
      ],
      "data": {
        "method": "POST",
        "endpoint": "get_upload_url",
        "endpointLabel": "get_upload_url",
        "description": "Request a pre-signed upload URL and the resulting file_path used later for conversion.",
        "ai_exposed": true,
        "summary": "",
        "advancedModeEnabled": false
      },
      "top": "97.7549px",
      "left": "93.3586px",
      "width": "",
      "height": "",
      "displayName": "APIEndpoint",
      "title": "get upload url",
      "aiTitle": "",
      "description": "Get an upload url from the server."
    },
    {
      "id": "CMEVAXP7R1ZI",
      "name": "APICall",
      "outputs": [
        { "name": "Response", "color": "#3C89F9", "index": 0, "default": true },
        { "name": "Headers", "color": "#3C89F9", "index": 1, "default": true }
      ],
      "inputs": [
        {
          "name": "filename",
          "type": "String",
          "friendlyInputType": "",
          "coreInputType": "String",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        }
      ],
      "data": {
        "method": "POST",
        "url": "{{API_BASE}}/file",
        "headers": "{\n  \"Authorization\": \"Basic {{KEY(FFMPEG_API_KEY)}}\"\n}",
        "contentType": "application/json",
        "body": "{\n  \"file_name\": \"{{filename}}\"\n}",
        "proxy": "",
        "oauthService": "None",
        "scope": "",
        "authorizationURL": "",
        "tokenURL": "",
        "clientID": "",
        "clientSecret": "",
        "requestTokenURL": "",
        "accessTokenURL": "",
        "userAuthorizationURL": "",
        "consumerKey": "",
        "consumerSecret": "",
        "authenticate": ""
      },
      "top": "13.7939px",
      "left": "484.004px",
      "width": "",
      "height": "",
      "displayName": "APICall",
      "title": "get upload url",
      "aiTitle": "",
      "description": "This endpoint is used to get an upload url from the server."
    },
    {
      "id": "CMEVAZTU5IB",
      "name": "APIOutput",
      "outputs": [
        { "name": "Output", "color": "#3C89F9", "index": 0, "default": true }
      ],
      "inputs": [
        {
          "name": "response",
          "type": "Any",
          "friendlyInputType": "",
          "coreInputType": "Any",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        }
      ],
      "data": { "format": "minimal" },
      "top": "138.535px",
      "left": "901.737px",
      "width": "",
      "height": "",
      "displayName": "APIOutput",
      "title": "APIOutput",
      "aiTitle": "",
      "description": ""
    },
    {
      "id": "MEVB392N9M",
      "name": "APICall",
      "outputs": [
        { "name": "Response", "color": "#3C89F9", "index": 0, "default": true },
        { "name": "Headers", "color": "#3C89F9", "index": 1, "default": true }
      ],
      "inputs": [
        {
          "name": "file",
          "type": "Binary",
          "friendlyInputType": "",
          "coreInputType": "Binary",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        },
        {
          "name": "upload_url",
          "type": "String",
          "friendlyInputType": "",
          "coreInputType": "String",
          "color": "#F35063",
          "optional": false,
          "index": 1,
          "default": false
        }
      ],
      "data": {
        "method": "PUT",
        "url": "{{upload_url}}",
        "headers": "{}",
        "contentType": "binary",
        "body": "{{file}}",
        "proxy": "",
        "oauthService": "None",
        "scope": "",
        "authorizationURL": "",
        "tokenURL": "",
        "clientID": "",
        "clientSecret": "",
        "requestTokenURL": "",
        "accessTokenURL": "",
        "userAuthorizationURL": "",
        "consumerKey": "",
        "consumerSecret": "",
        "authenticate": ""
      },
      "top": "575.594px",
      "left": "482.267px",
      "width": "",
      "height": "",
      "displayName": "APICall",
      "title": "upload file",
      "aiTitle": "",
      "description": "PUT: file to upload url"
    },
    {
      "id": "MEVB392O3AC",
      "name": "APIOutput",
      "outputs": [
        { "name": "Output", "color": "#3C89F9", "index": 0, "default": true }
      ],
      "inputs": [
        {
          "name": "response",
          "type": "Any",
          "friendlyInputType": "",
          "coreInputType": "",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        }
      ],
      "data": { "format": "minimal" },
      "top": "604.158px",
      "left": "906.316px",
      "width": "",
      "height": "",
      "displayName": "APIOutput",
      "title": "APIOutput",
      "aiTitle": "",
      "description": ""
    },
    {
      "id": "MEVBK2VO2YB",
      "name": "APIEndpoint",
      "outputs": [
        { "name": "headers", "color": "#3C89F9", "index": 0, "default": true },
        { "name": "body", "color": "#3C89F9", "index": 1, "default": true },
        { "name": "query", "color": "#3C89F9", "index": 2, "default": true },
        {
          "name": "task",
          "color": "#3C89F9",
          "expression": "body.task",
          "index": 3,
          "default": false
        }
      ],
      "inputs": [
        {
          "name": "task",
          "type": "Text",
          "friendlyInputType": "Text",
          "coreInputType": "Any",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        }
      ],
      "data": {
        "method": "POST",
        "endpoint": "convert_gif_to_mp4",
        "endpointLabel": "convert_gif_to_mp4",
        "description": "The task must be:\n{\n  \"inputs\": [{ \"file_path\": \"<returned file_path>\" }],\n  \"outputs\": [{ \"file\": \"<name>.mp4\" }]\n}\nUse the exact file_path from the upload-URL step and ensure the output ends with .mp4.",
        "ai_exposed": true,
        "summary": "",
        "advancedModeEnabled": false
      },
      "top": "1141.89px",
      "left": "62.7162px",
      "width": "",
      "height": "",
      "displayName": "APIEndpoint",
      "title": "convert gif to mp4",
      "aiTitle": "",
      "description": "This endpoint is used to convert a gif to mp4."
    },
    {
      "id": "MEVBK2VP3I9",
      "name": "APICall",
      "outputs": [
        { "name": "Response", "color": "#3C89F9", "index": 0, "default": true },
        { "name": "Headers", "color": "#3C89F9", "index": 1, "default": true }
      ],
      "inputs": [
        {
          "name": "task",
          "type": "Any",
          "friendlyInputType": "",
          "coreInputType": "Any",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        }
      ],
      "data": {
        "method": "POST",
        "url": "{{API_BASE}}/ffmpeg/process",
        "headers": "{\n  \"Authorization\": \"Basic {{KEY(FFMPEG_API_KEY)}}\"\n}",
        "contentType": "application/json",
        "body": "{\n    \"task\": {{task}}\n}",
        "proxy": "",
        "oauthService": "None",
        "scope": "",
        "authorizationURL": "",
        "tokenURL": "",
        "clientID": "",
        "clientSecret": "",
        "requestTokenURL": "",
        "accessTokenURL": "",
        "userAuthorizationURL": "",
        "consumerKey": "",
        "consumerSecret": "",
        "authenticate": ""
      },
      "top": "1052.83px",
      "left": "497.919px",
      "width": "",
      "height": "",
      "displayName": "APICall",
      "title": "process file",
      "aiTitle": "",
      "description": "POST: task to ffmpeg/process"
    },
    {
      "id": "MEVBK2VPZKI",
      "name": "APIOutput",
      "outputs": [
        { "name": "Output", "color": "#3C89F9", "index": 0, "default": true }
      ],
      "inputs": [
        {
          "name": "response",
          "type": "Any",
          "friendlyInputType": "",
          "coreInputType": "",
          "color": "#F35063",
          "optional": false,
          "index": 0,
          "default": false
        }
      ],
      "data": { "format": "minimal" },
      "top": "1096.6px",
      "left": "916.167px",
      "width": "",
      "height": "",
      "displayName": "APIOutput",
      "title": "APIOutput",
      "aiTitle": "",
      "description": ""
    }
  ],
  "connections": [
    {
      "sourceId": "MEVAWZ5MIST",
      "sourceIndex": 3,
      "targetId": "CMEVAXP7R1ZI",
      "targetIndex": 0
    },
    {
      "sourceId": "CMEVAXP7R1ZI",
      "sourceIndex": 0,
      "targetId": "CMEVAZTU5IB",
      "targetIndex": 0
    },
    {
      "sourceId": "MEVB392N9M",
      "sourceIndex": 0,
      "targetId": "MEVB392O3AC",
      "targetIndex": 0
    },
    {
      "sourceId": "CMEVAVJ01FNJ",
      "sourceIndex": 4,
      "targetId": "MEVB392N9M",
      "targetIndex": 1
    },
    {
      "sourceId": "MEVBK2VP3I9",
      "sourceIndex": 0,
      "targetId": "MEVBK2VPZKI",
      "targetIndex": 0
    },
    {
      "sourceId": "MEVBK2VO2YB",
      "sourceIndex": 3,
      "targetId": "MEVBK2VP3I9",
      "targetIndex": 0
    },
    {
      "sourceId": "CMEVAVJ01FNJ",
      "sourceIndex": 3,
      "targetId": "MEVB392N9M",
      "targetIndex": 0
    }
  ],
  "description": "Convert GIFs to MP4 using a cloud FFmpeg service to reduce size and improve playback compatibility.",
  "shortDescription": "GIF → MP4 converter (cloud-backed)",
  "behavior": "You convert GIFs to MP4 using ffmpeg-api.com. \n\nFlow: \n1) Get an upload URL: request a pre-signed URL and note the returned file_path. \n2) Upload the GIF: PUT the raw file bytes to the provided upload URL. \n3) Convert: send a task with the file_path and desired output file name ending in .mp4. \n\nRules: \n- Require an attached .gif file; if missing, ask the user to attach one. \n- Keep terminology consistent: 'upload URL', 'file_path', 'output file'. \n- On errors, report the step that failed, the HTTP status/message, and how to retry. \n- If the user provides an output name, ensure it ends with .mp4; otherwise default to output.mp4.",
  "variables": { "API_BASE": "https://api.ffmpeg-api.com" },
  "ui": {
    "panzoom": {
      "currentPan": { "x": 361.02367220712233, "y": -295.8674095982965 },
      "currentZoom": 0.5207696868896186
    },
    "agentCard": { "left": "-661.348px", "top": "-5.17188px" }
  },
  "introMessage": "Hi! Attach a GIF and I'll convert it to MP4 for you. You can also tell me what to name the output file (e.g., video.mp4)."
}
