Function Metadata TOML Files

Each Function must provide a project.toml TOML file that contains metadata for your Function, such as a description for the Function. This file should be located in your <project root>/functions/<function name> directory. The generate:function command (or SFDX: Create Function from VS Code) will automatically create a template project.toml file in the appropriate directory with some basic information.

The schema for the fields in project.toml follows the schema for the Cloud Native Buildpacks project descriptor, but extended with a Salesforce-specific section and fields. Sections from the Cloud Native Buildpacks project descriptor are namespaced using "_" in place of "project", so [project] becomes [_], project.licenses becomes _.licenses, metadata becomes _.metadata, etc.

For Functions, the following tables and fields are relevant:

TOML fieldTOML sectionField valueExample value
schema-version[_]The project descriptor schema version. For Functions this should currently be set to "0.2""0.2"
schema-version[com.salesforce]The schema version for the com.salesforce section, currently "0.1""0.1"
id[com.salesforce]The ID for the Function. Must be all lowercase or numeric characters, start with a letter, and have a maximum length of 30 characters"myfunctionid"
description[com.salesforce]The description for the Function. Optional"Tax calculation Function for Billing project"
type[com.salesforce]The project type. For Functions this should always be "function""function"

The following is an example project.toml for a Function:

For details on the general TOML file format, see toml.io