What We’re Building
In this tutorial, we’ll turn a Python data processing script into a governed tool that:- Has a clear input/output contract
- Runs in a sandboxed environment
- Produces downloadable artifacts
- Can be shared with anyone via a link — no local setup required
Prerequisites
- A Constants account (sign up here)
- A script or GitHub repository you want to turn into a Tool
- About 10 minutes of your time
Step 1: Import Your Script
From your dashboard, click Create new Tool. You have three options:Option A: Import from GitHub
Paste a GitHub URL pointing to your script:- Clone the repository
- Analyze the script structure
- Identify the entrypoint and dependencies
Option B: Upload Directly
Drag and drop your script file into the composer, or click the upload button to select files.Option C: Describe What You Need
If you don’t have an existing script, describe what you want:Step 2: Review the Detected Spec
After import, Constants analyzes your code and presents the detected spec:Input Schema
Output Schema
Step 3: Configure Runtime Settings
Set the execution environment:Resource Limits
Resource Limits
- CPU: 1-4 cores
- Memory: 512MB - 4GB
- Timeout: 30s - 30min
Secrets & Credentials
Secrets & Credentials
If your script needs API keys or database credentials:
- Add them in the Secrets section
- They’re injected as environment variables at runtime
- Receivers never see the actual values
Version Pinning
Version Pinning
Your Tool is pinned to a specific Git SHA. This ensures:
- Reproducible executions
- Clear provenance
- No surprise changes when the repo updates
Step 4: Create the Tool
Click Create Tool. Constants will:- Set up the sandboxed runtime
- Generate the UI form based on your input schema
- Initialize run history tracking
Step 5: Run Your Tool
Once created, you’ll see your Tool’s interface:- Upload your input CSV file
- Configure any optional parameters
- Click Run
- Real-time logs appear in the console
- Status updates show current progress
- Artifacts appear when complete
Step 6: Access Artifacts
After the run completes, you can:- Download the output file
- View the logs and execution metrics
- Replay the run with the same inputs
- Share the run results with teammates
Step 7: Share Your Tool
Your Tool is now ready to share:Share the Tool Link
Click Share to get a link. Recipients can:- View the Tool interface
- Enter their own parameters
- Run the Tool without any local setup
Share with Specific Users
Enter email addresses to share with specific teammates. They’ll get:- Access to run the Tool
- Their own run history
- Injected secrets (they never see the values)
Understanding the Interface
Run Button
Run Button
Run History
Run History
View all past executions with:
- Inputs used
- Outputs produced
- Execution time and resource usage
- Artifacts generated
Version Info
Version Info
See the Git SHA your Tool is pinned to. Update to a newer SHA when you want to pull in source changes.
Best Practices
Pin to SHA
Always pin production Tools to a specific Git SHA for reproducibility and auditability.
Define Clear Schemas
Well-defined input/output schemas make Tools easier to use for both humans and agents.
Set Resource Limits
Configure appropriate CPU, memory, and timeout limits to prevent runaway executions.
Use Secrets Properly
Never hardcode credentials. Use the Secrets feature to inject them at runtime.
Next Steps
Features Overview
Learn about all Constants primitives
API Reference
Programmatic access for automation
