Create & Test
Protocol for creating approved flows in Noukai via MCP and verifying them with test cases.
Entry condition: Only proceed here after the user has approved the migration plan from Audit & Design. You should have a list of approved flows with their block trees, prompts, and schemas.
Pre-Flight
Before creating any flows:
- Confirm the user has a
project_id. If not, they need to create an org and project first — see Quickstart. - Call
hydrate_project(project_id)to see what already exists. - Do NOT delete or modify any existing flows. Only create new ones.
Creation Protocol
Create each approved flow one at a time. Follow this sequence per flow:
Create the Flow
If the slug is taken, append a suffix (e.g. -v2) and inform the user. Do not overwrite existing flows.
Add Blocks
Add blocks following the designed tree topology. Use the MCP tool sequences from Common Workflows.
Sequential blocks — add each after the previous one:
Parallel blocks — add sequentially first, then wrap in a container:
Loop blocks — add the inner block, then wrap in a loop:
Configure Each Block
For every block, set the full configuration:
If the design specifies output schemas:
If the flow has a global input schema:
Create Test Cases
Create test cases to verify the flow works correctly. Derive test inputs from the user's existing codebase:
- Check for existing tests — search for test files that exercise the original chain. Extract their input data.
- Check for examples — look for example inputs in docstrings, comments, or README files.
- Check for hardcoded data — look for test/demo data in the codebase.
- If nothing found — generate representative inputs based on the flow's input schema.
Create at minimum two test cases per flow:
Present Test Interface
Provide the user with everything they need to test:
1. The API URL:
2. A ready-to-run curl command using one of the test case inputs:
3. The web UI link:
4. Ask the user to verify:
"I've created the following flows and published them:
Flow Slug Blocks Test Cases {name} {slug} {count} {count} You can test them using the curl commands above or in the web UI at app.noukai.xyz. When you're satisfied and ready to integrate into your code, say continue or implement."
Do not proceed to the Integration phase until the user signals readiness.
If Something Goes Wrong
- Slug conflict: Append
-migratedor-v2to the slug. Inform the user of the name change. - Block creation fails: Check the flow structure with
get_flow_structure(flow_id)and retry with corrected parameters. - Prompt too long: Split into multiple blocks. Update the design document if the user saved one.
- User wants changes: Use
update_block_draft,update_block_config, or structural tools (move_block,remove_block) to adjust. Do not delete the flow — modify in place.
After any changes, republish: