Automate Text Edits with n8n & Apple Shortcuts Using OpenAI

This n8n workflow automates text modifications triggered via Apple Shortcuts, leveraging OpenAI to seamlessly translate, grammar-correct, and adjust text length. Save time and eliminate manual editing errors with instant AI-powered responses directly replacing your selected text.
stickyNote
switch
openAi
+2
Learn how to Build this Workflow with AI:
Workflow Identifier: 2284
NODES in Use: Sticky Note, Switch, Respond to Webhook, Webhook, OpenAI

Press CTRL+F5 if the workflow didn't load.

Visit through Desktop for Best experience

1. Opening Problem Statement

Meet Sarah, a freelance content writer constantly juggling multiple articles every day. She frequently needs to translate snippets, fix grammar without changing meaning, or quickly adjust the length of her sentences and paragraphs. Doing all these edits manually wastes hours daily, interrupts her flow, and often results in inconsistent content quality. Sarah wishes there was an intuitive, instant way to automate these common text tasks without switching apps or copying and pasting to third-party services.

This exact challenge is what this n8n workflow solves using automation powered by OpenAI and Apple Shortcuts. It seamlessly integrates AI text editing directly triggered from anywhere on the Mac/iOS with a simple keyboard shortcut. The result? Sarah saves valuable time, boosts productivity, and maintains content quality with minimal effort.

2. What This Automation Does

This n8n workflow acts as an AI-powered text assistant triggered via Apple Shortcuts on Mac or iOS. When you select any text and activate your shortcut, the text is sent to a webhook that routes it to OpenAI for various AI-powered transformations based on your request. Specifically, the automation can:

  • Translate text to English or Spanish
  • Correct grammar without altering original meaning
  • Make the text shorter by about 5%
  • Make the text longer by about 5%
  • Respond instantly with the transformed text to replace your selection

By automating these common language tasks, it saves hours of manual editing and error-checking daily. Plus, it keeps your workflow focused without app switching or copy-paste delays.

3. Prerequisites ⚙️

  • n8n account (cloud or self-hosted) to run workflows
  • OpenAI API key – for GPT-powered text processing
  • Apple Shortcuts app installed on your Mac or iOS device
  • Webhook URL from n8n for your shortcuts to send requests
  • Keyboard shortcut set to launch the Apple Shortcut easily

4. Step-by-Step Guide

Step 1: Import and Activate the n8n Workflow

In your n8n editor, import the provided workflow JSON. Click Activate to make sure the webhook is live. You should see the webhook URL highlighted in the “Webhook from Shortcut” node. This webhook will receive POST requests from Apple Shortcuts.

Common mistake: Forgetting to activate the workflow will prevent text edits from working.

Step 2: Download and Install the Apple Shortcut Template

Download the shortcut text sample from the provided link. Open the Shortcuts app and import it.

Expected outcome: The shortcut “Text Automations using n8n” appears ready to customize in the Shortcuts app.

Step 3: Configure the Webhook URL in the Shortcut

In the shortcut steps, locate step 2 where the webhook URL is set. Replace the placeholder URL with your live n8n workflow webhook URL from “Webhook from Shortcut” node.

This connects your text selection to trigger the n8n workflow in real-time.

Step 4: Assign a Keyboard Shortcut to Launch the Automation

Inside the shortcut details, choose “Add Keyboard Shortcut” and assign your preferred key combo (e.g., Cmd+Shift+T). Also, enable “Allow Running Scripts” in shortcut advanced settings to permit seamless execution.

Visual tip: You should see the shortcut responding instantly when triggered via the keyboard.

Step 5: Understand the Workflow Trigger and Routing

The main entry is the Webhook from Shortcut node configured to accept POST requests with JSON body containing “content” and “type” fields.

The node feeds into a Switch node that evaluates the “type” parameter to route the request to the appropriate OpenAI node based on the transformation: translate to Spanish, English, grammar correction, shorten, or lengthen text.

Step 6: Configure OpenAI Nodes for Each Transformation

There are five separate OpenAI nodes:

  • OpenAI – To Spanish: Translates text to Spanish
  • OpenAI – To English: Translates text to English
  • OpenAI – Correct Grammar: Fixes grammar without content changes
  • OpenAI – Make Shorter: Compresses text by ~5%
  • OpenAI – Make Longer: Expands text by ~5%

Each node uses GPT-4o-mini model with a system prompt tailored to its task and expects JSON output with a single “output” field.

Step 7: Respond to Shortcut Node Sends Back the Result

All OpenAI nodes link to the Respond to Shortcut node which sends the AI-generated output back as plain text with line breaks handled for display.

This response replaces the selected text in the original document automatically.

5. Customizations ✏️

  • Add Additional Languages: Duplicate an OpenAI node, modify the system prompt for the new language translation, and update the Switch node conditions to route appropriately.
  • Adjust Text Length Variations: Change the system prompt in “OpenAI – Make Shorter/Longer” nodes to shorten or lengthen text by a different percentage.
  • Include Formal vs Informal Language Tones: Add parameters and modify prompts in OpenAI nodes to cater responses accordingly.
  • Extend to Other Text Transformations: Copy an OpenAI node and create tasks like summarization, sentiment analysis, or keyword extraction with suitable prompts.
  • Refine Output Formatting: Modify the “Respond to Shortcut” node’s response body to include HTML tags or adjust line break replacements for richer output compatibility.

6. Troubleshooting 🔧

Problem: “Webhook not responding or timing out”
Cause: Workflow not activated or webhook URL incorrect.
Solution: Activate the workflow in n8n, verify webhook URL match in the Shortcut settings.

Problem: “OpenAI API errors or empty response”
Cause: Invalid API key or exceeded usage limits.
Solution: Check your OpenAI credentials under n8n node settings and monitor usage on OpenAI dashboard.

Problem: “Shortcut not triggering workflow”
Cause: Keyboard shortcut not assigned or “Allow running scripts” disabled.
Solution: Set keyboard shortcut in Shortcut settings and enable “Allow running scripts” in advanced.

7. Pre-Production Checklist ✅

  • Ensure n8n workflow is active and webhook URL is accessible publicly.
  • Test sending sample text via Postman or Curl to the webhook endpoint with proper JSON structure.
  • Verify OpenAI nodes return structured JSON output without errors.
  • Confirm the Switch node properly routes different “type” parameters.
  • Test the complete flow through the Apple Shortcut with selected text to ensure replacements occur as expected.
  • Backup your workflow and shortcut profiles before major changes.

8. Deployment Guide

Activate your n8n workflow in a reliable environment (cloud or self-hosted). Confirm the webhook URL is reachable from your Apple devices. Share the shortcut JSON with users or devices and guide them to update the webhook URL.

Once deployed, monitor executions via n8n to handle any errors or usage spikes. Keep your OpenAI API keys secure and rotate periodically for safety. Consider logging key workflow data for audit and analytics.

9. FAQs

Can I use a different AI provider instead of OpenAI?

Currently, this workflow is built around OpenAI’s API and makes use of its specific prompt-response format. Integrating other AI providers requires customizing the OpenAI nodes and potentially switching node types.

Does this consume OpenAI API credits quickly?

Each text transformation counts as an API call. However, since requests are designed for short snippets, usage is efficient. Monitoring your quota regularly is recommended.

Is my text data safe?

Text data is sent to OpenAI and transit networks. Ensure you comply with confidentiality needs. Use secure connections and consider data anonymization if sensitive.

Can this automation handle large texts?

Large bodies of text might require chunking and can increase latency and API costs. Consider splitting the input before sending if necessary.

10. Conclusion

By implementing this n8n workflow coupled with Apple Shortcuts and OpenAI, you’ve created a powerful AI text automation assistant. You can now instantly translate, correct grammar, or adjust text length without leaving your current app, saving hours per week.

This automation reduces manual editing drudgery, helps maintain consistent quality, and speeds up writing workflows significantly.

Next steps could include expanding language support, integrating other AI text functions like sentiment analysis, or connecting this assistant with different platforms for even broader use.

Happy automating!

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free