({{, (RefLink[CloudFunction, paclet:ref/CloudFunction])[fun] 
represents a pure function that evaluates fun[args] in the cloud.}, {, (RefLink[CloudFunction, paclet:ref/CloudFunction])[(RefLink[CloudObject, paclet:ref/CloudObject])[…]]
represents a function that applies the contents of the specified cloud object.}, {, (RefLink[CloudFunction, paclet:ref/CloudFunction])[f,h]
wraps the head h around the result of the function before returning it.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[CloudFunction, paclet:ref/CloudFunction])[fun][args] evaluates args locally, then evaluates fun[args] in the cloud and returns the result.

(RefLink[CloudFunction, paclet:ref/CloudFunction])[(RefLink[CloudObject, paclet:ref/CloudObject])[…]][args] works only if the content of the (RefLink[CloudObject, paclet:ref/CloudObject]) is a Wolfram Language expression.

(RefLink[CloudFunction, paclet:ref/CloudFunction]) has the following option:

With (RefLink[IncludeDefinitions, paclet:ref/IncludeDefinitions])->(RefLink[True, paclet:ref/True]), definitions required for the evaluation of fun will automatically be sent to the cloud through (RefLink[CloudFunction, paclet:ref/CloudFunction]).

With (RefLink[IncludeDefinitions, paclet:ref/IncludeDefinitions])->(RefLink[False, paclet:ref/False]), definitions required for the evaluation of fun must be loaded and evaluated explicitly by fun itself.

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

CloudFunction[#1+#2&][3,4]

Store a function expression in the cloud and apply it:

func=CloudPut[FactorInteger[#]&]

CloudFunction[func][42]

OpenersExampleSection1(Spacer1)Generalizations & Extensions  (1)

Supply a head to be applied to the results of a cloud function application:

CloudFunction[#1+#2&,f][3,4]

func=CloudPut[FactorInteger[#]&];
CloudFunction[func,Plus@@#&][42]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

In a cloud evaluation, (RefLink[$CloudEvaluation, paclet:ref/$CloudEvaluation]) is set to (RefLink[True, paclet:ref/True]):

CloudFunction[$CloudEvaluation&][]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CloudEvaluate, paclet:ref/CloudEvaluate])  ▪  (RefLink[APIFunction, paclet:ref/APIFunction])  ▪  (RefLink[FormFunction, paclet:ref/FormFunction])  ▪  (RefLink[$CloudCreditsAvailable, paclet:ref/$CloudCreditsAvailable])  ▪  (RefLink[ExternalFunction, paclet:ref/ExternalFunction])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Cloud Functions & Deployment, paclet:guide/CloudFunctionsAndDeployment])}, {▪(RefLinkPlain[Creating Instant APIs, paclet:guide/CreatingAnInstantAPI])}})}})