<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Osama Mohamed</title>
    <description>The latest articles on DEV Community by Osama Mohamed (@osama_mohamed_9baca84844d).</description>
    <link>https://dev.to/osama_mohamed_9baca84844d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4245075%2F09483b10-8864-46b0-acda-38d45aaeb72a.jpg</url>
      <title>DEV Community: Osama Mohamed</title>
      <link>https://dev.to/osama_mohamed_9baca84844d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/osama_mohamed_9baca84844d"/>
    <language>en</language>
    <item>
      <title>7 n8n Errors Every Beginner Hits (and How to Fix Them)</title>
      <dc:creator>Osama Mohamed</dc:creator>
      <pubDate>Sat, 14 Nov 2026 20:50:37 +0000</pubDate>
      <link>https://dev.to/osama_mohamed_9baca84844d/7-n8n-errors-every-beginner-hits-and-how-to-fix-them-13l3</link>
      <guid>https://dev.to/osama_mohamed_9baca84844d/7-n8n-errors-every-beginner-hits-and-how-to-fix-them-13l3</guid>
      <description>&lt;p&gt;If you've built more than a couple of n8n workflows, you've stared at a red error box that made no sense. The good news: almost every beginner error comes from one of two things. Either &lt;strong&gt;the data isn't shaped the way you think&lt;/strong&gt;, or &lt;strong&gt;the node you're referencing didn't run&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here are the seven errors I see most often, what each one actually means, and the fix that works.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Cannot read properties of undefined (reading '...')
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it means:&lt;/strong&gt; you asked for a field inside something that doesn't exist &lt;em&gt;for this item&lt;/em&gt;. For example &lt;code&gt;$json.order.shipping.country&lt;/code&gt; when one order has no &lt;code&gt;shipping&lt;/code&gt; block.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to tell which case you're in:&lt;/strong&gt; if &lt;em&gt;every&lt;/em&gt; item fails, you probably have a typo in a parent field name. If only &lt;em&gt;some&lt;/em&gt; items fail, the data is genuinely missing for those items.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; use optional chaining plus a default value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shipping&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;country&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s1"&gt;'Unknown'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;?.&lt;/code&gt; stops at the first missing level instead of crashing, and &lt;code&gt;??&lt;/code&gt; gives a fallback.&lt;br&gt;
Full walkthrough: &lt;a href="https://workflowexercise.com/errors/n8n-cannot-read-properties-of-undefined/" rel="noopener noreferrer"&gt;Cannot read properties of undefined in n8n&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  2. .map is not a function
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it means:&lt;/strong&gt; you called &lt;code&gt;.map()&lt;/code&gt; on something that isn't an array. Two usual suspects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The array arrived as a &lt;strong&gt;JSON string&lt;/strong&gt; (&lt;code&gt;"[\"a\",\"b\"]"&lt;/code&gt;). Forms, Google Sheets cells and some APIs do this.&lt;/li&gt;
&lt;li&gt;An API returns a single &lt;strong&gt;object&lt;/strong&gt; when there's one result and an array only when there are several.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fix for the string case:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the "sometimes object, sometimes array" case, &lt;code&gt;[].concat($json.tags)&lt;/code&gt; always gives you an array.&lt;br&gt;
More causes and fixes: &lt;a href="https://workflowexercise.com/errors/n8n-map-is-not-a-function/" rel="noopener noreferrer"&gt;.map is not a function in n8n&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Unexpected token o in JSON at position 1
&lt;/h2&gt;

&lt;p&gt;This one looks cryptic, but it has a funny explanation. When you &lt;code&gt;JSON.parse()&lt;/code&gt; something that is &lt;strong&gt;already an object&lt;/strong&gt;, JavaScript first turns it into the text &lt;code&gt;"[object Object]"&lt;/code&gt;. The character at position 1 is &lt;code&gt;o&lt;/code&gt;, so the parse fails.&lt;/p&gt;

&lt;p&gt;n8n's Webhook and HTTP Request nodes usually parse JSON for you, so the extra &lt;code&gt;JSON.parse()&lt;/code&gt; is the bug. (If you see &lt;code&gt;Unexpected token &amp;lt;&lt;/code&gt;, the API returned an HTML error page instead of JSON.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; only parse when the value is actually a string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nv"&gt;$json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'string'&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plan&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Details: &lt;a href="https://workflowexercise.com/errors/n8n-unexpected-token-in-json/" rel="noopener noreferrer"&gt;Unexpected token in JSON in n8n&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. JSON parameter needs to be valid JSON
&lt;/h2&gt;

&lt;p&gt;You'll hit this in the HTTP Request node when you build a JSON body by hand and drop expressions into it. It breaks as soon as a value contains a double quote or a line break (customer messages and AI output are the usual culprits), or when you forget the quotes around a text expression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; stop hand-writing the JSON. Build the whole body as an object and let &lt;code&gt;JSON.stringify()&lt;/code&gt; handle the escaping:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;note&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;note&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step by step: &lt;a href="https://workflowexercise.com/errors/n8n-json-parameter-needs-to-be-valid-json/" rel="noopener noreferrer"&gt;JSON parameter needs to be valid JSON&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Referenced node is unexecuted
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;$('Some Node')&lt;/code&gt; only works if that node actually ran in this execution. It fails when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the node sits on the &lt;strong&gt;other branch&lt;/strong&gt; of an IF or Switch that wasn't taken, or&lt;/li&gt;
&lt;li&gt;the node is connected &lt;strong&gt;after&lt;/strong&gt; the current one, not before it, or&lt;/li&gt;
&lt;li&gt;you're testing a single node and the earlier nodes haven't been executed yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; reference a node that runs on every path (for example the trigger or a lookup before the IF). If you need data from both branches, bring them back together with a Merge node first.&lt;/p&gt;

&lt;p&gt;More: &lt;a href="https://workflowexercise.com/errors/n8n-referenced-node-is-unexecuted/" rel="noopener noreferrer"&gt;Referenced node is unexecuted&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Paired item data for item from node is unavailable
&lt;/h2&gt;

&lt;p&gt;n8n quietly tracks which input item produced each output item. That's what makes &lt;code&gt;$('Node').item&lt;/code&gt; work. The link breaks when a &lt;strong&gt;Code node builds brand-new items&lt;/strong&gt; or when &lt;strong&gt;Aggregate, Summarize or Merge&lt;/strong&gt; combine several items into one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; when the earlier node had a single item, read it directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$(&lt;/span&gt;&lt;span class="s1"&gt;'Webhook'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you write the Code node yourself, you can keep the link by returning &lt;code&gt;pairedItem&lt;/code&gt; with each new item.&lt;br&gt;
Explained with examples: &lt;a href="https://workflowexercise.com/errors/n8n-paired-item-data-unavailable/" rel="noopener noreferrer"&gt;Paired item data is unavailable&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. The requested webhook is not registered
&lt;/h2&gt;

&lt;p&gt;Every Webhook node has &lt;strong&gt;two URLs&lt;/strong&gt;, and this error almost always means you're using the wrong one:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Test URL&lt;/strong&gt; (&lt;code&gt;/webhook-test/...&lt;/code&gt;) only listens while you're in the editor waiting for a test event.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production URL&lt;/strong&gt; (&lt;code&gt;/webhook/...&lt;/code&gt;) only works when the workflow is active.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; point your form or app at the production URL and activate the workflow. Use the test URL only while you're building.&lt;/p&gt;

&lt;p&gt;Checklist: &lt;a href="https://workflowexercise.com/errors/n8n-webhook-not-registered/" rel="noopener noreferrer"&gt;The requested webhook is not registered&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The 3-step habit that prevents most of these
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Look at the real input&lt;/strong&gt; in the node's input panel before writing an expression. Don't assume the shape.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expect missing and inconsistent data.&lt;/strong&gt; Use &lt;code&gt;?.&lt;/code&gt;, &lt;code&gt;??&lt;/code&gt; and type checks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make sure the node you reference ran&lt;/strong&gt; for this item.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Want to practice instead of just reading?
&lt;/h2&gt;

&lt;p&gt;I put together free, interactive n8n and Make.com labs at &lt;strong&gt;&lt;a href="https://workflowexercise.com/" rel="noopener noreferrer"&gt;WorkflowExercise&lt;/a&gt;&lt;/strong&gt;. You get a real JSON payload and a broken or missing expression, and your answer is executed against test data, so you know if it actually works. The full list of error fixes is here: &lt;strong&gt;&lt;a href="https://workflowexercise.com/errors/" rel="noopener noreferrer"&gt;n8n &amp;amp; Make error fixes&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Which n8n error cost you the most time? Drop it in the comments and I'll add a fix for it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I built WorkflowExercise. It's an independent project, not affiliated with n8n.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>n8nbrightdatachallenge</category>
      <category>automation</category>
      <category>javascript</category>
      <category>nocode</category>
    </item>
  </channel>
</rss>
