PiAPI Kling Video Extend icon

PiAPI Kling Video Extend

Extend an existing Kling video

Overview

This node, named "PiAPI Kling Video Extend," is designed to extend an existing Kling video by creating a new task based on the original video's task ID. It interacts with an external API to request the extension of a Kling video and optionally waits for the extension task to complete before returning the result.

Common scenarios where this node is beneficial include:

  • Automatically extending videos generated by Kling without manual intervention.
  • Integrating Kling video extension into automated workflows, such as content pipelines or video editing processes.
  • Waiting for the extended video processing to finish before proceeding with subsequent workflow steps.

For example, a user might input the original Kling video task ID and choose to wait for completion, ensuring that the extended video is ready before moving forward in their automation.

Properties

Name Meaning
Original Task ID The task ID of the original Kling video to extend. This identifies which video to extend.
Wait for Completion Whether to wait for the extension task to complete before returning the result. Options: true or false.

Output

The node outputs an array of JSON objects, each representing the response from the Kling API:

  • If Wait for Completion is false, the output JSON contains the immediate response from the API after requesting the video extension, including at least a task_id and other task-related data.
  • If Wait for Completion is true, the node waits until the extension task completes and then outputs the final task data.
  • In case of errors (and if the node is configured to continue on failure), the output JSON will contain an error field with the error message.

The output JSON structure typically includes:

{
  "task_id": "string",
  "status": "string",
  "result": { /* extended video details */ },
  ...
}

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the PiAPI service.
  • Depends on the external Kling API endpoint /api/v1/task to create and monitor video extension tasks.
  • Uses internal helper functions (piApiRequest and waitForTaskCompletion) to handle API requests and task polling.

Troubleshooting

  • API Error: If the API returns a non-200 status code, the node throws an error with the message from the API. Ensure the provided Original Task ID is valid and the API key has sufficient permissions.
  • Timeouts or Long Waits: When "Wait for Completion" is enabled, the node waits for the task to finish. If the task takes too long or never completes, consider disabling this option or increasing timeout settings if available.
  • Invalid Input: Missing or incorrect Original Task ID will cause the API request to fail. Always provide a valid string ID.
  • Credential Issues: Make sure the API key credential is correctly configured in n8n; otherwise, authentication will fail.

Links and References

Discussion