Reads each Google Doc you list, summarises it with AI, and appends every summary to one digest document.
Uses
Google Docs
OpenAI
Summarise a batch of documents into one digest
documentLinks to blank.Set documentLinks to blank.digestDocumentLink to blank.Set digestDocumentLink to blank.summaryInstructions to Give at most three bullet points covering what the document is for and what it decides or asks for, then a final line starting 'Follow-ups:' naming any owners, dates or open questions it mentions..Set summaryInstructions to Give at most three bullet points covering what the document is for and what it decides or asks for, then a final line starting 'Follow-ups:' naming any owners, dates or open questions it mentions..maxCharactersPerDocument to 12000.Set maxCharactersPerDocument to 12000.digestDocumentLink starts with httpIf digestDocumentLink starts with httpYes
digestDocumentLink doesn't contain /d/If digestDocumentLink doesn't contain /d/Yes
No
No steps
No
No steps
digestDocumentLink split by /d/ and save it as digestLinkTail.Get the last item of digestDocumentLink split by /d/ and save it as digestLinkTail.digestLinkTail split by / and save it as digestDocumentId.Get the first item of digestLinkTail split by / and save it as digestDocumentId.digestDocumentId is emptyIf digestDocumentId is emptyYes
No
No steps
documentLinks by a new line and save it as documentList.Split documentLinks by a new line and save it as documentList.summaries to an empty list.Set summaries to an empty list.skipped to an empty list.Set skipped to an empty list.link in documentList:For each link in documentList:link and save it as documentLink.Trim link and save it as documentLink.documentLink is emptyIf documentLink is emptyYes
No
No steps
documentLink starts with httpIf documentLink starts with httpYes
documentLink doesn't contain /d/If documentLink doesn't contain /d/Yes
documentLink to the end of skipped and save it as skipped.Add documentLink to the end of skipped and save it as skipped.No
No steps
No
No steps
documentLink split by /d/ and save it as linkTail.Get the last item of documentLink split by /d/ and save it as linkTail.linkTail split by / and save it as documentId.Get the first item of linkTail split by / and save it as documentId.documentId is emptyIf documentId is emptyYes
documentLink to the end of skipped and save it as skipped.Add documentLink to the end of skipped and save it as skipped.No
No steps
documentText to blank.Set documentText to blank.readErrorIf a step below fails, save the error as readErrorTry
documentId. Save it as document.Read documentId. Save it as document.document.text and save it as documentText.Trim document.text and save it as documentText.On error
documentLink: readError as text.Show in the output: Could not read documentLink: readError as text.documentText is emptyIf documentText is emptyYes
documentLink to the end of skipped and save it as skipped.Add documentLink to the end of skipped and save it as skipped.No
No steps
prompt to You are summarising one document for a colleague who has not read it. Use only what the document says, and do not invent anything it does not contain.Set prompt to You are summarising one document for a colleague who has not read it. Use only what the document says, and do not invent anything it does not contain.
summaryInstructions
Start your answer with a single line naming the document, then the summary.
Document link: documentLink
Document text:
documentText truncated to maxCharactersPerDocument characters.summary to blank.Set summary to blank.summaryErrorIf a step below fails, save the error as summaryErrorTry
prompt. Save it as modelReply.Ask OpenAI: prompt. Save it as modelReply.modelReply.response_text and save it as summary.Trim modelReply.response_text and save it as summary.On error
documentLink: summaryError as text.Show in the output: Could not summarise documentLink: summaryError as text.summary is emptyIf summary is emptyYes
documentLink to the end of skipped and save it as skipped.Add documentLink to the end of skipped and save it as skipped.No
No steps
summaryAdd summary
Source: documentLink to the end of summaries and save it as summaries.summaries is emptyIf summaries is emptyYes
No
No steps
digest to Document summaries - today's dateSet digest to Document summaries - today's date
summaries joined by a blank line.skipped isn't emptyIf skipped isn't emptyYes
digest to digestChange digest to digest
Could not be read: skipped joined by , .No
No steps
digestDocumentId.Add text to digestDocumentId.digestsummaries as text document summaries to the digest.Show in the output: Added the length of summaries as text document summaries to the digest.