Your upcoming_to_tasks chains Calendar to Tasks. Now Docs to LinkedIn. You have a milestone note in a Google Doc — how do you turn it into a LinkedIn post?
After upcoming_to_tasks the chain pattern is natural. For LinkedIn milestones, I write a sentence in my board notes doc — 'We crossed $10k MRR today. Here's what I learned.' — then copy-paste it into LinkedIn. Every time.
Read the doc, extract the first paragraph, post it. GOOGLEDOCS_GET_DOCUMENT_BY_ID gives you the content tree. Extract the text from the first paragraph. Then LINKEDIN_CREATE_LINKED_IN_POST publishes it:
doc = read_doc(doc_id)
content = doc.get("body", {}).get("content", [])
first_para = ""
for element in content:
if "paragraph" in element:
for run in element["paragraph"].get("elements", []):
first_para += run.get("textRun", {}).get("content", "")
breakThat's a lot of nesting just to get the first paragraph. Is there a simpler way?
The Docs content tree is deeply nested — paragraphs contain elements which contain text runs. For milestone posts, keep the doc's first paragraph short and punchy. The extraction is boilerplate you write once. Here's the full function:
def doc_to_post(doc_id: str) -> dict:
doc = toolset.execute_action(Action.GOOGLEDOCS_GET_DOCUMENT_BY_ID, {"document_id": doc_id})
content = doc.get("body", {}).get("content", [])
post_text = ""
for element in content:
if "paragraph" in element:
for run in element["paragraph"].get("elements", []):
post_text += run.get("textRun", {}).get("content", "")
if post_text.strip():
break
result = toolset.execute_action(Action.LINKEDIN_CREATE_LINKED_IN_POST, {"text": post_text.strip()})
print(f"Posted to LinkedIn: {post_text[:50]}")
return resultWrite the milestone sentence in Docs, run doc_to_post, and it appears on LinkedIn. The writing is still mine — the publishing is automated.
The best automation doesn't replace the thinking — it removes the copy-paste.
Docs to LinkedIn in one chain. Read the doc, extract text, post. Five apps in four weeks.
LinkedIn has character limits and formatting rules. Keep milestone posts under 700 characters for best reach. Test with a short first paragraph in your doc before pointing at your real milestone notes.
Read the doc, extract first paragraph text, post to LinkedIn. This chain removes the copy-paste step between your private milestone notes and your public founder narrative — the writing stays yours, the publishing is automated.
doc = GOOGLEDOCS_GET_DOCUMENT_BY_ID(doc_id)
# extract paragraph text from nested content tree
LINKEDIN_CREATE_LINKED_IN_POST(text=post_text)Content is nested: body.content[].paragraph.elements[].textRun.content. Always extract the first non-empty paragraph and strip whitespace.
LinkedIn posts have character limits. Keep milestone sentences under 700 characters.
Your upcoming_to_tasks chains Calendar to Tasks. Now Docs to LinkedIn. You have a milestone note in a Google Doc — how do you turn it into a LinkedIn post?
After upcoming_to_tasks the chain pattern is natural. For LinkedIn milestones, I write a sentence in my board notes doc — 'We crossed $10k MRR today. Here's what I learned.' — then copy-paste it into LinkedIn. Every time.
Read the doc, extract the first paragraph, post it. GOOGLEDOCS_GET_DOCUMENT_BY_ID gives you the content tree. Extract the text from the first paragraph. Then LINKEDIN_CREATE_LINKED_IN_POST publishes it:
doc = read_doc(doc_id)
content = doc.get("body", {}).get("content", [])
first_para = ""
for element in content:
if "paragraph" in element:
for run in element["paragraph"].get("elements", []):
first_para += run.get("textRun", {}).get("content", "")
breakThat's a lot of nesting just to get the first paragraph. Is there a simpler way?
The Docs content tree is deeply nested — paragraphs contain elements which contain text runs. For milestone posts, keep the doc's first paragraph short and punchy. The extraction is boilerplate you write once. Here's the full function:
def doc_to_post(doc_id: str) -> dict:
doc = toolset.execute_action(Action.GOOGLEDOCS_GET_DOCUMENT_BY_ID, {"document_id": doc_id})
content = doc.get("body", {}).get("content", [])
post_text = ""
for element in content:
if "paragraph" in element:
for run in element["paragraph"].get("elements", []):
post_text += run.get("textRun", {}).get("content", "")
if post_text.strip():
break
result = toolset.execute_action(Action.LINKEDIN_CREATE_LINKED_IN_POST, {"text": post_text.strip()})
print(f"Posted to LinkedIn: {post_text[:50]}")
return resultWrite the milestone sentence in Docs, run doc_to_post, and it appears on LinkedIn. The writing is still mine — the publishing is automated.
The best automation doesn't replace the thinking — it removes the copy-paste.
Docs to LinkedIn in one chain. Read the doc, extract text, post. Five apps in four weeks.
LinkedIn has character limits and formatting rules. Keep milestone posts under 700 characters for best reach. Test with a short first paragraph in your doc before pointing at your real milestone notes.
Read the doc, extract first paragraph text, post to LinkedIn. This chain removes the copy-paste step between your private milestone notes and your public founder narrative — the writing stays yours, the publishing is automated.
doc = GOOGLEDOCS_GET_DOCUMENT_BY_ID(doc_id)
# extract paragraph text from nested content tree
LINKEDIN_CREATE_LINKED_IN_POST(text=post_text)Content is nested: body.content[].paragraph.elements[].textRun.content. Always extract the first non-empty paragraph and strip whitespace.
LinkedIn posts have character limits. Keep milestone sentences under 700 characters.
Create a free account to get started. Paid plans unlock all tracks.