$ cat workspace-template.yaml
Social Posts Payloads
// Template per la creazione di post social su Instagram, facebook, X e LinkedIn partendo da und ocumento del Drive. Genera un'anteprima del post per ciascun social e il payload necessario alla pubblicazione nelle piattaforme social
// Canvas Preview
// Instruction
Social Posts Payloads
Overview
This workflow automates the creation of social media content by extracting text from Google Drive documents and transforming it into platform-specific posts. It produces both an HTML preview and a structured JSON payload for Facebook, X (Twitter), Instagram, and LinkedIn, requiring only the selection of the source document(s) from Drive.
Workflow Chain
Node Reference
- Drive Document Reader: Extracts text content from selected Google Drive documents.
- Inputs from: User selection.
- Configurable inputs:
driveItemId(UUID of the document). - Output:
content(string).
- Facebook Post Payload: Generates a Facebook-optimized post.
- Inputs from: Drive Document Reader.
- Configurable inputs:
Riassunto_Contenuto_Facebook__prompt(default: "Riassumi questo contenuto in modo conciso e accattivante per un pubblico Facebook."). - Output:
Social_Post_Payload__preview_html,Social_Post_Payload__payload.
- X Post Payload: Generates a professional X post.
- Inputs from: Drive Document Reader.
- Configurable inputs:
Riassunto_Contenuto__prompt(default: "Riassumi questo contenuto per creare un post X professionale e coinvolgente."). - Output:
Social_Post_Payload__payload,Social_Post_Payload__preview_html.
- Instagram Post Payload: Generates a short, punchy Instagram caption.
- Inputs from: Drive Document Reader.
- Configurable inputs:
Testo_Instagram__prompt(default: "Riassumi questo contenuto in un testo per Instagram di 138-150 caratteri..."). - Output:
Social_Post_Payload__payload,Social_Post_Payload__preview_html.
- Linkedin Post Payload: Generates a long-form professional LinkedIn post.
- Inputs from: Drive Document Reader.
- Configurable inputs:
Testo_LinkedIn__prompt(default: "Trasforma questo riassunto in un post LinkedIn completo..."). - Output:
Social_Post_Payload__payload,Social_Post_Payload__preview_html.
Execution Strategy
You MUST complete all 3 phases in order: Phase 1 -> Phase 2 -> Phase 3. Do NOT skip any phase.
-
Phase 1: Initialization and Selection
- Call
requestUserDecisionto confirm: a) Which Drive document(s) to process? (Context: Source material for posts) b) Do you want to customize any specific platform prompts? (Context: Default prompts are provided, but can be overridden) c) Do you want to proceed with generating all four platform payloads? (Context: Confirm scope) - Phase 1 complete. Now proceed to Phase 2. Do NOT skip to Phase 3.
- Call
-
Phase 2: Content Processing
- Execute
Drive Document Readerusing the selecteddriveItemId. - For EACH platform node (Facebook, X, Instagram, LinkedIn), repeat:
a) Pass the
contentoutput from the reader to the respectiveRiassunto_Contenutoorcontentinput port. b) Trigger the node execution to generate thepreview_htmlandpayload. - Phase 2 complete. Now proceed to Phase 3.
- Execute
-
Phase 3: Review and Follow-up
- Present the generated
preview_htmlfor each platform to the user. - Call
followUpto ask: "Would you like to regenerate any specific post, or are you ready to export the JSON payloads?"
- Present the generated
Configuration Tips
Error Handling
- Node Execution Failure: Often caused by empty Drive documents. Verify the document contains text before running.
- Missing Input: If a node fails to trigger, ensure the edge from
Drive Document Readeris correctly connected to thecontentport of the target node. - API Timeout: If the document is extremely long, the LLM may time out. Split the document into smaller files if necessary.
Incremental Edits to an Existing Workflow
- Detection: If the canvas already contains the four macro nodes, treat as an edit.
- Add/Remove: To remove a platform, delete the node and its associated edge. To add a new platform, clone an existing macro node and connect the
contentoutput fromDrive Document Reader. - Post-edit: After any structural change, run
autoLayout()to maintain readability. Re-run the Phase 1-3 sequence to verify the new configuration.
// Dependencies
1from input import DriveDocumentReader