Prompt Edit ✏️:
Prompt_Edit gives you a chance to review and change text while a workflow is running. When execution reaches the node, it creates an editing session, notifies the frontend, and waits for confirmation before continuing. This is useful when a generated prompt needs a human check, such as correcting a subject, adjusting a style description, or removing unwanted wording. The node passes the confirmed text onward, so later steps can use your reviewed version. It waits for up to one hour; the exact editing and confirmation controls depend on the frontend that handles its session message.
Prompt Edit ✏️ Input Parameters:
text
The original text to review. This is a required STRING input that must arrive through a connection from another node; the source sets forceInput to True, so it is not configured as a manually entered field on this node. It supplies the starting text for the editing session and becomes the returned text if the editing field is empty or contains only whitespace when execution begins and no later edit replaces it. For example, you could connect the prompt produced by an upstream text-generation node. No minimum length, maximum length, or default value is specified.
edited_text_widget
An optional-in-practice editing value exposed as a required STRING field: it is a multiline text box with a default of "" and dynamicPrompts set to False. If it contains any non-whitespace characters when the node begins execution, the node uses its complete contents as the initial candidate for the result; otherwise, it uses text. Spaces or line breaks surrounding actual words are preserved because the node checks a trimmed copy only to decide whether the field has content. You can use this field to prepare revised wording before running the workflow. No minimum or maximum length is specified.
Prompt Edit ✏️ Output Parameters:
edited_text
The single STRING output contains the text held by the editing session when it is confirmed. Connect it to a later node that should receive your reviewed prompt or other revised text. The session starts with edited_text_widget if that field contains non-whitespace text, or with text otherwise; a frontend confirmation process may update the session’s text before the node returns. The node also includes the final text in its UI response, but that is not an additional output socket.
Prompt Edit ✏️ Usage Tips:
- Connect an upstream text source to
textand place Prompt_Edit immediately before the step that should use your reviewed wording. - Leave
edited_text_widgetempty when you want the incoming text to be the initial candidate. Enter a draft there when you want to start from a prepared revision. - Make your edits and confirm the session in the frontend before expecting downstream nodes to run. The node waits for confirmation and stops with a timeout after approximately one hour.
- Check the final wording before confirming. Whitespace around nonempty content in
edited_text_widgetis retained, so remove unintended spaces or blank lines yourself.
Prompt Edit ✏️ Common Errors and Solutions:
编辑超时(1小时)
- Explanation: The editing session was not confirmed within the node’s one-hour timeout. The source also logs
Prompt edit timeout for session {session_id}. - Solution: Run the workflow again, complete your edits, and confirm the new session within one hour. Check that the frontend is displaying the editing session if you did not see it.
Error sending prompt edit session: {error}
- Explanation: The node caught an error while trying to notify the frontend about the new session and printed this message. Because it then continues waiting, you may not see an editor even though the workflow appears to be running.
- Solution: Check that the frontend and server connection are working, then rerun the workflow. If the message persists, share the full printed error with the extension maintainer; the text after the colon identifies the underlying problem.
Workflow remains paused with no editing prompt
- Explanation: The node is waiting for its session to be marked confirmed. The provided class sends a
prompt_edit_sessionmessage, but the frontend handler and confirmation mechanism are not included in the supplied source, so their behavior cannot be verified here. - Solution: Check that the frontend component for Prompt_Edit is installed and connected, and look for an editing or confirmation control associated with the node. If none appears, inspect the server log for
Error sending prompt edit session:and report the issue to the extension maintainer.
Missing required input: text
- Explanation:
textis required and configured to come from a connection. The exact validation wording depends on the host application and is not defined in this class. - Solution: Connect a node that produces text to the
textinput, then run the workflow again.
