---
schema_version: "1"
id: 51b7342100965a0897a13efe76fd07790602e496ca67a3da233ceb0a5befcdb5
title: Functions Namespace
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_namespace_functions.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_functions.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: f4cfb3efc20a712db48123a556f380f64e7ab956a933bf85c934e381c0978510
description: The Functions namespace provides classes and methods used to invoke and manage Salesforce Functions.
---
# Functions Namespace

The Functions namespace provides classes and methods used to invoke and manage Salesforce Functions.

Salesforce Functions is your code, run on demand, in the Salesforce Functions trusted elastic compute cloud. Upload your complex business logic code, written using your preferred languages and frameworks, and Salesforce Functions takes care of everything else necessary to invoke your code in a secure, multi-tenant aware, and self-scaling environment. For more details on Salesforce Functions, see [Salesforce Functions](https://developer.salesforce.com/docs/platform/functions/guide).

The following are the classes in the functions namespace.

- **[Function Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_functions_Function.htm#apex_class_functions_Function)**  
    Use the Function class to access deployed Salesforce Functions, and invoke them synchronously or asynchronously.
- **[FunctionCallback Interface](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_functions_FunctionCallback.htm#apex_interface_functions_FunctionCallback)**  
    Represents the callback Salesforce calls when an asynchronous, queued Function invocation has completed.
- **[FunctionErrorType Enum](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_functions_FunctionErrorType.htm)**  
    Represents the error type of FunctionInvocationError.
- **[FunctionInvocation Interface](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_functions_FunctionInvocation.htm#apex_interface_functions_FunctionInvocation)**  
    Use FunctionInvocation to get the status and results of a synchronous or asynchronous Function invocation.
- **[FunctionInvocationError Interface](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_functions_FunctionInvocationError.htm#apex_interface_functions_FunctionInvocationError)**  
    Use FunctionInvocationError to get detailed error information about a failed Function invocation.
- **[FunctionInvocationStatus Enum](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_functions_FunctionInvocationStatus.htm)**  
    Represents the status of a Function invocation.
- **[FunctionInvokeMock Interface](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_functions_FunctionInvokeMock.htm#apex_interface_functions_FunctionInvokeMock)**  
    Use the FunctionInvokeMock interface to mock Salesforce Functions responses during testing.
- **[MockFunctionInvocationFactory Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_functions_MockFunctionInvocationFactory.htm#apex_class_functions_MockFunctionInvocationFactory)**  
    Use the MockFunctionInvocationFactory methods to generate appropriate mock responses for testing Salesforce Functions.