Actions6
- Chat Actions
- Completion Actions
- Feedback Actions
Completion → Stop Generation
AI-generatedOverview
This node integrates with the Dify AI platform, enabling users to manage AI completions among other functionalities. Specifically, the "Stop Generation" operation under the "Completion" resource allows users to halt an ongoing text generation task by providing its task ID. This is useful in scenarios where a generated completion is no longer needed or if the user wants to interrupt the process due to changing requirements.
Practical examples include:
- Stopping a long-running AI text generation that is taking too much time.
- Interrupting a generation when the user realizes the input prompt was incorrect.
- Managing multiple concurrent generation tasks and selectively stopping some of them.
Properties
| Name | Meaning |
|---|---|
| Task ID | The unique identifier of the completion generation task you want to stop (e.g., "task-12345678-1234-5678-9012-123456789012"). This is required. |
| User ID | (Optional) The identifier of the user associated with the task, used for tracking or authorization purposes (e.g., "user123"). |
Output
The output JSON contains the response from the Dify API after attempting to stop the specified completion generation task. It typically includes confirmation of the stop action or error details if the operation failed.
No binary data output is involved in this operation.
Dependencies
- Requires an API key credential for authenticating with the Dify AI platform.
- The node expects the base URL and API key to be configured in the credentials.
- Network connectivity to the Dify API endpoint is necessary.
Troubleshooting
Common issues:
- Providing an invalid or non-existent Task ID will likely result in an error from the API indicating the task cannot be found.
- Missing or incorrect API credentials will cause authentication failures.
- Network issues can prevent communication with the Dify service.
Error messages:
"The operation "stop" is not supported for resource "completion": This indicates a misconfiguration or typo in the operation name.- Errors returned from the API are passed through; typical messages might include "Task not found" or "Unauthorized".
Resolutions:
- Verify the Task ID is correct and corresponds to an active generation task.
- Ensure API credentials are valid and have sufficient permissions.
- Check network connectivity and proxy settings if applicable.
Links and References
- Dify AI Platform Documentation (for API details and usage)
- n8n documentation on Creating Custom Nodes