Swirls

SWIRLS_

  • How it works
  • Pricing

56 matches

OverviewDeliver client operations10Win and grow accounts8Resolve customer issues6Create and distribute content9Run people and operations5Review money and agreements3Monitor systems and data9Compose dependable work6

56 matches

OverviewDeliver client operations10Win and grow accounts8Resolve customer issues6Create and distribute content9Run people and operations5Review money and agreements3Monitor systems and data9Compose dependable work6
← Content & MediaFormView on GitHub

Content Translator

Translates content into multiple languages with tone preservation.

ai

Source

/**
 * Translates content into multiple languages using AI.
 */

form translate_form {
  label: "Translate Content"
  schema: @json {
    {
      "type": "object",
      "required": ["content", "target_language"],
      "properties": {
        "content": { "type": "string", "title": "Content to Translate" },
        "target_language": {
          "type": "string",
          "title": "Target Language",
          "enum": ["Spanish", "French", "German", "Japanese", "Portuguese", "Chinese"]
        },
        "tone": {
          "type": "string",
          "title": "Tone",
          "enum": ["formal", "casual", "technical"],
          "default": "formal"
        }
      }
    }
  }
}

workflow translate_content {
  label: "Translate Content"

  root {
    type: code
    label: "Extract request"
    code: @ts { return context.nodes.root.input }
    outputSchema: @json {
      {
        "type": "object",
        "properties": {
          "content": { "type": "string" },
          "target_language": { "type": "string" },
          "tone": { "type": "string" }
        }
      }
    }
  }

  node translate {
    type: ai
    label: "Translate"
    kind: object
    model: "google/gemini-2.5-flash"
    prompt: @ts {
      const req = context.nodes.root.output
      return "Translate the following content into " + req.target_language + " using a " + (req.tone || "formal") + " tone. Preserve formatting.\n\nContent:\n" + req.content
    }
    schema: @json {
      {
        "type": "object",
        "required": ["translation", "source_language"],
        "properties": {
          "translation": { "type": "string" },
          "source_language": { "type": "string" },
          "notes": { "type": "string" }
        }
      }
    }
  }

  node format_result {
    type: code
    label: "Format result"
    code: @ts {
      const req = context.nodes.root.output
      const result = context.nodes.translate.output
      return {
        original: req.content,
        translated: result.translation,
        from: result.source_language,
        to: req.target_language,
        notes: result.notes || ""
      }
    }
  }

  flow {
    root -> translate
    translate -> format_result
  }
}

trigger on_translate {
  form:translate_form -> translate_content
  enabled: true
}

Flow

Trigger to workflow

translate_formform
translate_content
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

Workflow nodes

CODE
Code Node
Extract request
AI
AI Node
Translate
CODE
Code Node
Format result
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.