---
schema_version: "1"
id: 71c133b4fe8cd77a633b79b8071d6eee115f24043dc242b9cf76df7598abca94
title: Code Extension in Data 360
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-code-ext/guides/use-custom-code.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/use-custom-code.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6213c99468930dd19bdc46bb11d7bd096356340c0beadd03a130a7e73c77ab4a
products:
  - Data 360 Code Extension Guide
  - Data 360 Developer Documentation
---
# Code Extension in Data 360

**note:** As of October 14, 2025, Data Cloud has been rebranded to Data 360. During this transition, you may see references to Data Cloud in our application and documentation. While the name is new, the functionality and content remains unchanged.

**note:** Code extension isn't currently supported in orgs that have Bring Your Own Key (BYOK) enabled.

You can bring your custom Python code into Data 360 to extend Data 360's native capabilities by using code extension. If the native Data 360 features don't meet your business requirements, deploy your custom logic to supported Data 360 features.

Code extension supports two types of custom code, which differ in how they run:

- Scripts run as a batch data transform—a job that you run on demand or schedule. See [Use Custom Scripts in Data 360](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/use-custom-script.md).
- Functions run as part of the search index pipeline, where they control how content is chunked for search and AI retrieval. See [Use Custom Functions in Data 360](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/function/use-custom-function.md).

## Code Extension Workflow

The code extension workflow spans local development, sandbox validation, and production deployment. **Developers** author and debug code locally, then deploy to Data 360 sandbox. **Users with a Data Cloud Architect permission set** manage code execution, monitoring, and migration in Data 360 environments.

![Code Extension Development Workflow](https://developer.salesforce.com/docs/media/data-cloud-code-ext/code-extension-workflow-v2.png)

1. **Write and Validate a Code Extension**: Developers write Python code in their local integrated development environment (IDE) and validate it locally by using Salesforce CLI against a sandbox org. See [Set Up Salesforce CLI for Code Extension](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/set-up-sdk.md).

2. **Deploy to Sandbox**: Developers deploy their validated code to Data 360 sandbox by using the Web UI, API, or Salesforce CLI.

3. **Invoke Code Extension in Sandbox**: Data 360 users invoke the deployed code extension in a Data 360 feature. For a custom script, create a batch data transform that uses it. For a custom function, select it as the chunking strategy when you create a search index.

4. **Run Code Extension in Sandbox**: Data 360 users run the Data 360 feature to execute the code extension in the sandbox environment. For a custom script, run or schedule the batch data transform. For a custom function, the function runs when the search index builds.

5. **Monitor and Validate in Sandbox**: Data 360 users review execution logs, performance metrics, and output data to verify that the code extension works as expected.

6. **Package for Production**: After successful validation in the sandbox, Data 360 users package the code extension, the Data 360 features that use it, and their dependencies into a data kit for migration to production.
7. **Install Data Kit in Production**: Data 360 users install the packaged data kit containing the validated components into the production environment.

8. **Invoke Code Extension in Production** (if needed): If only the code extension was migrated, Data 360 users invoke it in a Data 360 feature. For a custom script, create a batch data transform that uses it. For a custom function, select it as the chunking strategy in a search index.

9. **Run Code Extension in Production**: Data 360 users run the Data 360 feature to execute the code extension and process live production data. For a custom script, run or schedule the batch data transform. For a custom function, the function runs when the search index builds.

10. **Monitor in Production**: Data 360 users monitor execution logs, performance metrics, and output data to ensure reliable operation in production.

## Next Step

- [Set Up Salesforce CLI for Code Extension](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/set-up-sdk.md)
- [Use Custom Scripts in Data 360](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/use-custom-script.md)
- [Use Custom Functions in Data 360](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/function/use-custom-function.md)

## See Also

- [_Salesforce Help_: Billing Considerations for Code Extension](https://help.salesforce.com/s/articleView?id=data.c360_a_billing_considerations_code_extension.htm&type=5)
