AI agent instructions
AI agent instructions
Viewing Functions
List All Functions
View your deployed Functions:list_functions.py
page_size). Use page and the response’s has_next to read further pages. In Python, client.functions.list() and list_runs() default to only_active=True.
Get Function Details
Retrieve specific Function information: Setfunction_id (Python) or functionId (Node) to your deployed Function’s ID.
Updating Functions
Update Function Code
Deploy a new version of your Function:update_code.py
Update Function Metadata
Change the name, description, or default runtime withPATCH /functions/{function_id}, or fn.updateMetadata() in TypeScript. The Python SDK has no wrapper for this call yet.
Versioning
Version Management
Functions automatically version on each update:Roll Back to a Previous Version
Cloud runs always execute the latest version. To go back to an older one, roll back withPOST /functions/{function_id}/rollback and a version from versions, or fn.rollback({ version }) in TypeScript. The old code is redeployed as a new latest version:
rollback_version.py
Version History
Track changes across versions:Monitoring Executions
View Run History
List recent Function executions: Before running this example, setfunction_id (Python) or functionId (Node)
to the ID of the Function whose history you want to inspect. Pass only_active=False to include finished and failed runs.
Check Run Status
Monitor specific execution: Setfunction_id and run_id (Python), or functionId and runId (Node),
to your Function’s ID and the run ID returned by its execution.
active- Function is currently runningclosed- Function completed successfullyfailed- Function encountered an error
Filter Active Runs
View only running executions:Viewing Replays
Access Function Replay
Watch MP4 replay of Function execution:access_replay.py
- Video recording of browser session
- Shows all actions taken
- Useful for debugging failures
- Available after running a function
Replay After Run
Get replay immediately after execution:replay_after_run.py
Managing Runs
Stop Running Function
Cancel a long-running execution:stop_running.py
Monitoring Long Runs
Track execution progress:Forking Functions
Fork Shared Function
Create your own copy of a shared Function:fork_function.py
- Customize shared Functions
- Create templates from marketplace
- Copy teammate’s Functions
- Experiment without affecting original
Modify Forked Function
After forking, update as needed:modify_forked.py
Downloading Functions
Download Function Code
Retrieve Function source code:download_code.py
- Only works for Functions you own or have access to
- Notte-managed functions also need their decryption key, passed as
decryption_keywhen creating the Function instance
Download for Backup
Back up all your Functions:backup_functions.py
Deleting Functions
Delete Function
Remove a Function permanently:delete_function.py
- Deletion is permanent
- All versions are deleted
- Cannot be undone
Sharing Functions
Make Function Public
Share Functions with others:make_public.py
- ✅ Others can view and fork
- ✅ Original remains under your control
- ❌ Others cannot modify your version
Private Functions
Keep Functions private (default):Best Practices
1. Version Your Functions
Update incrementally with clear changes:version_backup.py
2. Monitor Function Health
Regular health checks:function_health_check.py
3. Clean Up Old Runs
Archive or analyze old execution data:cleanup_old_runs.py
4. Document Changes
Keep change log for Function updates:document_changes.py
5. Test Before Production
Validate updates before deploying:test_before_prod.py
Troubleshooting
Function Fails to Run
Check run details for errors:troubleshoot_fails.py
Missing Secrets
Function Secrets reach your code as environment variables (see Secrets). Check for them at the start ofrun():
missing_env_vars.py
High Failure Rate
Analyze failure patterns: Setfunction_id (Python) or functionId (Node) to your Function’s ID.
Include completed runs with only_active=False / only_active: false so failed runs appear.
Next Steps
Creating Functions
Learn how to write Functions
Invocations
Call Functions via API or SDK
Schedules
Schedule Functions with cron
Functions Concept
Back to Functions overview