# Testing and Debugging Test your custom actions before deploying them to production --- > **Note:** Custom actions require a Studio plan or higher. > href="https://build.chipp.ai/plans" > target="_blank" > rel="noopener noreferrer" > > > > Upgrade to Studio → > ## Built-in Request Tester Test your actions directly in the configuration interface. ### 1. Configure Your Action Set up your URL, method, and parameters as usual. ### 2. Open Test Panel Expand **Test Request** at the bottom of the action editor. After a run, the result shows: - Resolved URL with variables - Headers with substitutions - Body data structure - Query parameters ### 3. Test Values for AI Parameters The tester does not ask you for values for AI-filled parameters. It sends each parameter's **Sample value**, or a placeholder such as `` when there is no sample. A parameter set to **Output from another action** works the same way with its **Test value**, because a test has no earlier action output. If your auth **Credential source** is **Collected from the user each session**, paste a **Test credential**; it is used for that test only and never stored. ### 4. Execute Test Click **Run Test** to: - Send actual HTTP request - View response status - Inspect response body - Check response time ### 5. Review Results ```json { "status": 200, "response": { "results": [ { "id": 123, "title": "Customer Support Guide" } ], "total": 42 }, "time": "234ms" } ``` ## Testing Strategies ### Variable Resolution Verify all variables resolve correctly: ```bash URL: {{var.BASE_URL}}/api/{{endpoint}} Header: Bearer {{var.API_KEY}} URL: https://api.example.com/api/users Header: Bearer sk-abc123... ``` ### Parameter Types The **Type** setting on an AI-filled parameter decides what the AI may send in chat. Test Request does not apply it: it sends sample values and fixed values as text. To check typed values end to end, run the action in a chat: | Type | AI sends | Your API receives (JSON body) | | ------------ | ------------------ | ----------------------------- | | Text | `"hello world"` | A string | | Number | `19.99` | A number | | Whole number | `42` | An integer | | True / false | `true` | A boolean | | Object | `{"key": "value"}` | A JSON object | | List (array) | `[1, 2, 3]` | A JSON array | ### Edge Cases Test boundary conditions: - **Empty values**: Optional parameters - **Special characters**: URLs, JSON strings - **Large payloads**: Big objects/arrays - **Invalid inputs**: Error handling ## Common Issues ### Authentication Errors **401 Unauthorized** ```json { "error": "Invalid API key" } ``` **Solution**: Check your API key variable: 1. Verify the variable value 2. Check header format (`Bearer`, `Basic`, etc.) 3. Ensure secret type for sensitive values ### CORS Chipp sends test requests and live action calls from its servers, not from your browser, so your API does not need CORS headers for `build.chipp.ai`. ### Variable Not Resolving **Issue**: The request fails with `Variable not found: API_KEY` **Debug Steps**: 1. Check variable exists in Variables tab 2. Verify exact name match (case-sensitive) 3. Ensure variable has a value 4. Check syntax: `{{var.NAME}}` ### JSON Parse Errors **Issue**: Body parameters not formatting correctly ```json // Bad { "data": "{"nested": "value"}" } // Good { "data": { "nested": "value" } } ``` **Solution**: Use proper type (Object/Array) for nested data ## Debug Mode The **Test Request** result shows the request and the response: ### Request Details View the exact request being sent: ```bash POST https://api.example.com/endpoint Headers: Authorization: Bearer [REDACTED] Content-Type: application/json Body: { "query": "test search", "filters": { "status": "active" } } ``` ### Response Details Inspect full response: ```json { "status": 200, "headers": { "content-type": "application/json", "x-request-id": "req_123" }, "body": { "success": true, "data": [...] } } ``` ## Testing Dependencies For actions that use **Output from another action**: ### 1. Test the First Action Run Test Request on the first action and look at its response. Write your JSONPath against that real response, for example `$.data.id` for `{"data": {"id": 123}}`. ### 2. Test the Second Action on Its Own Test Request cannot run the chain. A chained parameter sends its **Test value** (or a `` placeholder), so set the test value to a realistic value from step 1. The editor checks the JSONPath syntax when you save. It cannot check that the path exists in the first action's response, so compare the path with the response from step 1. ### 3. Test the Full Chain in a Chat 1. Ask something that makes the AI run the first action 2. Ask something that needs the second action, in the same conversation 3. Check that your API received the right value, in your API logs or a request inspector Chipp keeps the first action's result for 30 minutes. If the AI calls the second action first, or after that, the call stops and the AI is told to run the first action again. If the JSONPath finds nothing in the result, the call stops with a message that names the path. ## Performance Testing ### Response Times Monitor action performance: | Metric | Good | Warning | Bad | | ------------- | ------ | ---------- | ------- | | Response Time | <500ms | 500-2000ms | >2000ms | | Timeout | - | - | 120s | ### Optimization Tips 1. **Use pagination** for large datasets 2. **Cache responses** when appropriate 3. **Minimize payload size** 4. **Use specific field selection** ## Error Handling ### Graceful Failures Design actions to fail gracefully: ```json { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "User with ID 123 not found" } } ``` ### Retry Logic For transient failures: - Network timeouts - Rate limiting - Temporary server errors ### User-Friendly Messages AI receives and can relay error context: ```json { "error": "Unable to send email: recipient address invalid" } ``` ## Production Checklist Before using in production: ### Security - [ ] API keys in secret variables - [ ] HTTPS endpoints only - [ ] No sensitive data in URLs - [ ] Proper authentication headers ### Reliability - [ ] All parameters tested - [ ] Error responses handled - [ ] Dependencies verified - [ ] Endpoint responds well within the 120 second timeout ### Performance - [ ] Response times acceptable - [ ] Payload sizes optimized - [ ] Rate limits considered - [ ] Caching implemented ### Documentation - [ ] Clear action descriptions - [ ] AI instructions complete - [ ] Example values provided - [ ] Variable purposes documented ## Troubleshooting Guide | Issue | Cause | Solution | | ---------------------- | ----------------- | ------------------------------------- | | Variables not replaced | Syntax error | Check `{{var.NAME}}` format | | Auth fails | Wrong credentials | Update variable value | | Timeout | Slow API | Optimize endpoint (requests time out after 120 seconds) | | Wrong data | Bad JSONPath | Compare the path with the first action's real response | | No response | CORS/Network | Check API accessibility | ## Next Steps - [View Examples →](/docs/custom-actions/examples) - [Parameter Configuration →](/docs/custom-actions/parameters) - [Manage Variables →](/docs/custom-actions/variables)