is an option for DocumentGenerator allowing arbitrary code to be executed after a document is generated.
EpilogFunction
is an option for DocumentGenerator allowing arbitrary code to be executed after a document is generated.
Details
- EpilogFunction may be a pure function, notebook, CloudObject, or File. If qualified as Delayed, the resource will be used in place and no copy will be maintained in the generator bundle.
- Functions will be passed the file name of the generated document. All types of epilog functions have access to the generated document through the variable $CurrentFile.
- In case of template application failure, the epilog function will not execute.
Examples
Basic Examples (1)
co = CloudDeploy[
DocumentGenerator[File["ExampleData/BasicTemplate.nb"], <|"author" :> $WolframID|>, None,
EpilogFunction :> (CloudPut[{Now, $WolframID, $EvaluationCloudObject, FileByteCount[#]}, CloudObject["epilog/last-runner"]]&)
],
CloudObject["epilog-function-example"]
]Trigger the generator to run synchronously:
TaskExecute[co]Examine contents of the cloud object generated by the epilog function:
CloudGet[CloudObject["epilog/last-runner"]]TaskRemove[co]History
Text
Wolfram Research (2015), EpilogFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/EpilogFunction.html.
CMS
Wolfram Language. 2015. "EpilogFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EpilogFunction.html.
APA
Wolfram Language. (2015). EpilogFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EpilogFunction.html
BibTeX
@misc{reference.wolfram_2026_epilogfunction, author="Wolfram Research", title="{EpilogFunction}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/EpilogFunction.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_epilogfunction, organization={Wolfram Research}, title={EpilogFunction}, year={2015}, url={https://reference.wolfram.com/language/ref/EpilogFunction.html}, note=[Accessed: 13-June-2026]}