Docs & Code Guide

Embed diagrams in Google Docs: By URL is a snapshot, and the honest workarounds

The direct answer first: Google Docs does not do live image embeds. Insert, then Image, then By URL fetches the image once, stores a copy inside the document, and never looks at your URL again. There is no iframe support to fall back on. Any diagram pasted into a Doc starts aging the moment it lands. What follows are the three workflows that respect this limitation instead of pretending it away.

6 min readFor teams whose design docs and RFCs live in Google Docs

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

184/20003 credits left
Try:

No account needed · Editable canvas, not a picture

What By URL actually does

When you insert an image by URL, Google Docs downloads it at insert time and stores that copy with the document. The URL is not retained as a live reference: edit the image at the source and the Doc keeps showing the version from insert day. This is deliberate on Google's side, documents are self-contained, but it means the mechanism that keeps a diagram current in Notion, Confluence, or a docs site simply does not exist in Docs.

It is worth saying plainly because the same URL behaves differently elsewhere: paste a live image URL into a wiki that hotlinks it and the page follows the source; paste it into a Google Doc and you have a snapshot. The staleness is invisible, too. The copied image looks identical to a live one until someone compares it against the system and finds a service that no longer exists.

Workflow two: Apps Script replaces the snapshot on demand

For long-lived Docs that many people read, a small Apps Script can re-fetch the image and swap it in place. Run it manually or on a time-driven trigger, and the Doc carries a snapshot that refreshes itself on your schedule. This is the closest Docs gets to a live embed, and it is honest about what it is: a scheduled re-copy, not a live reference.

function refreshDiagram() {
  const URL = 'https://datadef.io/api/embed/my-platform-a1b2c3d4';
  const doc = DocumentApp.openById('YOUR_DOC_ID');
  const body = doc.getBody();
  const images = body.getImages();
  if (images.length === 0) return;
  const old = images[0]; // first image in the doc: the architecture diagram
  const blob = UrlFetchApp.fetch(URL).getBlob();
  const parent = old.getParent();
  const index = parent.getChildIndex(old);
  old.removeFromParent();
  parent.asParagraph().insertInlineImage(index, blob);
}

Trigger it

In the Apps Script editor, add a time-driven trigger (for example, daily) for refreshDiagram. The Doc then carries at most one day of staleness instead of unbounded staleness.

Workflow three: Google Sites when you need a real embed

If the artifact does not have to be a Doc, Google Sites embeds URLs in-page, which Docs cannot. An internal Sites page carrying the interactive diagram gives readers pan and zoom and always shows the current version. Teams often land on a split: Docs for the narrative that does not change, a Sites page or the diagram link itself for the picture that does.

Keeping the source diagram current, and the limits

All three workflows lean on the source diagram being correct, and Docs being in the picture changes nothing about that maintenance. When the architecture moves, update the diagram by hand, or hand the job to an agent that has the Datadef MCP server, registry name io.datadef/mcp, among its tools: it reads the repository and makes the edit, after which a Sites embed is current within minutes and the next Apps Script run refreshes the Doc snapshot. Datadef triggers nothing itself and detects no code changes; the agent needs an API key, which paid plans include. The embed and image URLs exist only for projects shared public.

Why documents drift from reality in the first place, and why image snapshots drift worst, is covered in why documentation goes stale. Google Docs is simply the environment where the drift is least visible, because the snapshot never looks broken, only wrong.

FAQ

Does Insert Image By URL in Google Docs update when the source image changes?

No. Google Docs downloads the image once at insert time and stores that copy in the document; the source URL is not re-fetched. An updated image at the same URL changes nothing in the Doc.

Can I embed an iframe in Google Docs?

No. Google Docs has no iframe or embed block for external pages. The alternatives are linking out to the live content, refreshing an image snapshot with Apps Script, or using Google Sites, which does embed external URLs.

How do I keep an architecture diagram current in a Google Doc?

Choose your staleness window. Zero staleness: link to the live diagram and let readers click. Bounded staleness: an Apps Script on a time-driven trigger that re-fetches the image and replaces it in the Doc. Unbounded staleness: a pasted image with a visible snapshot date, acceptable for short-lived docs.

Is there any live diagram embed for Google Docs?

Not natively; every image in a Doc is a stored copy. The closest approximation is scheduled replacement via Apps Script. For a genuinely live view, host the diagram on a page that supports embeds, such as Google Sites or a wiki that hotlinks images, and link the Doc to it.

Should design docs carry diagrams at all if they go stale?

Yes, with the staleness made visible: date the snapshot and link the live version underneath. A design doc is partly a historical record, so a dated snapshot of the proposal is legitimate; the danger is only an undated image being mistaken for the current system.