> For the complete documentation index, see [llms.txt](https://docs.dckapintegrator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dckapintegrator.com/tutorials/workflow-builder-tutorial/5.-best-practices.md).

# 📚 5. Best Practices

### **1. Reduce Code Runner Usage**

* Code Runner can cause performance issues
* Use only when no other tool is available
* Impact of Code Runner Usage: Extra execution time
* Avoid using code runner in a loop.

**💡 Better Alternative: Inline Transformations + Workflow Variables**

* Combination of Workflow Variables and Inline Transformations should be your first choice
* They are lightweight and performant
* Use these before considering Code Runner

### **2. Use Console Logs Wisely**

* Console Logs are helpful during development to debug and verify steps are working
* For production workflows, minimize Console Logs to avoid performance degradation
* **Alternative: Use the Debugger option for debugging instead**
* Impact: Writing logs takes time and slows down workflow completion

#### How Debug Mode Works (Simple Example)

Use the toggle to enable Debug Mode on for a workflow. Set up breakpoints. A breakpoint is like a "pause button" you place in your workflow step — when the workflow runs and hits that spot, it freezes so you can inspect exactly what's happening at that moment. You can set up break points by clicking on&#x20;

<figure><img src="/files/VJtzq7hW2u59YDY17D5s" alt=""><figcaption></figcaption></figure>

Steps with breakpoints set appears as below:

<figure><img src="/files/dH9sXFiG6yU7OQLMJAIt" alt=""><figcaption></figcaption></figure>

Click on Sync Now on the top right to run Workflow in Debug Mode.

Assume breakpoints are set at Step 3 and Step 6.&#x20;

When you run the workflow in Debug Mode:

1. Steps 1 and 2 execute normally.
2. Execution pauses at Step 3.

Two options appear:

* Run This Step → Executes only Step 3
* Continue → Executes Steps 3, 4, and 5

3. Execution pauses again at Step 6 with the same options.&#x20;

**Note:**&#x20;

*If there are loops in between and you have set breakpoints in any branching step your execution might pause at a loop prompting you to choose between Run This Step/ Continue.*<br>

4. To stop debugging, select Exit Debugger on the top right.

<figure><img src="/files/5WvuKhTR20cM8QqxjBiP" alt=""><figcaption></figcaption></figure>

This allows you to observe data and behavior step by step, without affecting logs or production settings.

### **3. Utilize Snippets for Reusability**

* Save complex logic as Snippets and reuse across workflows
* Reduces repetitive step building
* Improves workflow maintainability
* Optimization benefit: Build once, use multiple times


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dckapintegrator.com/tutorials/workflow-builder-tutorial/5.-best-practices.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
