Simulate API requests with mock outputs. Mock outputs gives you fake but realistic responses, making it much easier to see how changes you make will effect your workflow. Mock outputs are great for trying out new features or tweaking your current setup, ensuring everything runs smoothly before going live. They're a simple yet powerful tool to improve and test your workflows efficiently.
Explore the Versatility of Mock Outputs for Your Workflows
Simplify Workflow Testing: Easily run parts of your workflow to pinpoint how changes affect the bigger picture, without needing to go through every step. It’s a great way to make adjustments and see immediate results in a controlled environment.
Dive Deep into Specific Outputs: Manually set responses for certain steps. When you're dealing with tricky scenarios like errors or unusual cases, this can help ensure your workflow logic holds up under various conditions.
Streamline Adding New Sections: Grab a mock output from an earlier step to seamlessly blend the new section in. This approach is also perfect for focusing on just a piece of a more extensive process, making testing less of a headache.
Progress Without Full Integration: Mock outputs let you fill in the gaps, allowing you to test and refine steps even if you’re still setting up integrations.
Mock output configurations are disabled when the workflow is published and don't affect workflow executions in production.
How to Use Mock Output
Initiate Mock Output Configuration:
Create Your Mock Output:
Enter your desired mock data in the Output field. Utilize the suggested step output example as a starting point, or modify a previous step's output from the Execution Log for a more tailored approach.
For modifications or reversions, the step’s three-dot menu offers an Output Example option for reference.
Activate Mock Output:
Toggle the Enable mock output switch to Yes. This activation is visually indicated by a yellow frame around the step.
Execute with Mock Output:
Test Your Workflow with Mock Outputs:
Troubleshooting and Tips
Valid JSON Format & Size: If you encounter errors with mock outputs not behaving as expected, double-check that your mock data is in a valid JSON format and under the size limit of 100KB.
Testing in Phases: For complex workflows, consider testing in sections to isolate and address any issues more effectively.
Reverting Changes: Utilize the Output Example feature to easily revert any changes to the mock output if you need to start fresh.
The step properties, input parameters, integration, and Execution Options (runners, ignore failure, discard data, and so on) are ignored when the step is executed with mock output.
Mock output configurations are saved when the workflow is published and are available to use in any future development of the workflow.
Mock output configurations will be exported and imported with the workflow.
Use Cases
These examples demonstrate how mock outputs can be useful for different purposes.
Output as Mock Ouptut
Output as Mock Ouptut
Copy the step output example and modify the values to create a mock output that has the expected response structure with your test data. In the example below, a mock output for the Okta List Users with Filters step is created by using the step output example and modifying it to include the data of the users you don't mind testing the flow on.
Mock Output to Avoid API Request
Mock Output to Avoid API Request
Use a mock output to get a preconfigured response for the step into the context for other steps to reference without executing the step in production. In the example below, a mock output is used for the Okta Suspend User step when running the workflow with real user data to avoid suspending anyone while being able to test the rest of the flow.
The example is a simplified version of the Suspend Contractor Accounts with no logins in 7 days template.
Go Templates in Mock Outputs
Go Templates in Mock Outputs
You can use Go templates to customize your mock outputs even further. In the example below, the value of a variable from the context determines which of two mock output versions will be used.