Introduction to {M}aker
{M}aker is a governance system for M code (Power Query) where Power BI queries do not live inside the .pbix file, but in a centralized database. Power BI executes a "launcher" query that downloads the code from the server and runs it with Expression.Evaluate on every data refresh.
mmaker()) that downloads and executes the code in real time.
Why {M}aker
In environments with multiple Power BI reports, maintaining M code directly in .pbix files presents several problems:
- Duplication: the same query is copied across reports and diverges over time.
- No versioning: there is no native way to see previous versions of M code or rollback.
- No centralized parameterization: each report has its own hardcoded values.
- No reuse: sharing a set of queries between reports requires manual copy-paste.
{M}aker solves all this with a central repository of versioned, parameterizable, and reusable queries.
Key concepts
Queries
A query is a Power Query M expression divided into named steps. Each query has a versioning system with drafts: changes accumulate in a draft that is explicitly activated as a new version. Previous versions are immutable and you can rollback to any of them.
Reports
A report groups queries and assigns them a unique access token. From Power BI, the launcher function uses that token to download each query's code. Reports allow configuring different parameter values ({{PARAM}}) for each query, and support multiple tokens (multi-token) for parameter RLS scenarios.
Packs
A pack is a reusable group of queries that can be assigned to multiple reports. Typical use case: a "dimensions" pack (date tables, products, customers) shared across all reports in an organization.
DW (Data Warehouse)
The DW module allows loading data from Excel/CSV files into dynamic MySQL tables. It is organized in three levels:
- Pipeline
- Reusable process configuration: defines how to parse a file type (columns, globals, fixed values, keys, validations, post-load steps). A pipeline can be shared across multiple bloques.
- Bloque
- Instance with its own identity: has a unique table name and references a pipeline. Each bloque generates its own dynamic table in the DW database.
- App
- Grouping of bloques with a fallback pipeline. Organizes related bloques under the same umbrella (e.g., "Sales" with bloques "National Sales", "Export Sales").
BPM / Kanban
Process management system over data loads. Each bloque can have a Kanban board with configurable states, transitions between states (with optional pipelines that execute on transition), and actions that can be invoked on existing loads.
User Portal
Simplified interface for end users (usuario role). Allows uploading files, viewing load status and history without access to technical configuration.
How the system works
The basic flow of {M}aker is:
- The configurator creates queries with M code in {M}aker, organized in named steps.
- Queries are grouped into reports, where parameter values are configured.
- Each report has a unique access token.
- In Power BI, a launcher function
mmaker()is created with the report's token. - Each query in the report is invoked with
mmaker("query_name", true, true). - On every refresh, Power BI calls the server, downloads the updated M code, and executes it.
Interface navigation
Topbar
The top bar contains the {M}aker logo and, if you have access to multiple projects, a project selector that filters the entire interface by project. Each project has an assigned color for quick visual identification.
Sidebar
The left sidebar has 5 sections, each collapsible:
| Section | Content |
|---|---|
| DW | Tree of Apps with their nested Bloques. "+ Bloque" button to create new bloques. |
| Pipelines | List of independent pipelines. "+ Pipeline" button to create new ones. |
| Queries | Flat list of all queries. Clicking shows M code without applied parameters. |
| Reports | List of reports with assigned queries as expandable child nodes. "+ Report" button. |
| Packs | List of packs with their queries as expandable child nodes. "+ Pack" button. |
The search bar at the top of the sidebar filters by name across all sections simultaneously. Collapsed sections auto-expand if they contain results, and restore when the search is cleared.
Main panel
The central area shows the detail of the element selected in the sidebar, with different tabs depending on the resource type (structure, loads, data, versions, M code, etc.).
User roles
{M}aker implements a hierarchy of 4 roles with incremental permissions:
| Role | Access | Typical use |
|---|---|---|
| superadmin | Entire system: all companies, all users, all configuration. | Global platform administrator. |
| admin | Their company and child projects. Can create projects (sub-companies) and manage users. | Head of a consulting firm or client company. |
| desarrollador | Full {M}aker interface: queries, reports, packs, DW, pipelines. No admin access. | Technical configurator who works with the system day to day. |
| usuario | Portal only: upload files, view status, check history. | End user who uploads data but does not configure anything. |
usuario role are automatically redirected to the portal on login. They do not have access to the {M}aker configuration interface.
Consulting firm model
Companies can have a parent-child relationship (consulting firm-project). A company with parent_id is a project under a parent company. Admins see their company and all its projects; superadmins see everything.
Company "Consulting Firm" (parent)
+-- Admin: ana@consultingfirm.com
+-- Project "Client Acme" (child)
| +-- Developer: dev@consultingfirm.com
| +-- User: contact@acme.com (portal only)
+-- Project "Client Beta" (child)
Next steps
Check the following sections of this wiki to dive deeper into each area:
- Queries: creation, versioning, placeholders and references between queries.
- Reports: query grouping, access tokens, launchers, and multi-token.
- Packs: reusable query groups shared across reports.
- DW - Pipelines: data load process configuration.
- DW - Bloques: data instances with their own table.
- DW - Apps: bloque grouping.
- BPM / Kanban: process and state management over loads.
Queries
A query in {M}aker is a Power Query M expression with a unique name, divided into ordered steps. Queries are the fundamental resource of the system: everything else (reports, packs, launchers) is built on top of them.
Query types
Each query has a type that determines how it's used from Power BI. The type shows in the sidebar as a letter (T/S/C) next to the name:
- T (transform): pure query, only M transformations (
Table.*,List.*,Text.*,Date.*...). Invoked viammaker()and refreshes in PBI Service. Default type. - S (staging): query with connectors (
Excel.Workbook,SharePoint.Files,Sql.Database,Web.Contents...). Pasted literal in the .pbix as a separate query, its output feeds a transform. See Power BI integration guide for details. - C (completa): full query with connectors in "quick & dirty" mode. Requires the Desktop variant of
mmakerpasted in the.pbix(same name, body uses#shared). Does NOT refresh in PBI Service.
Creating a query
To create a query, click "+ Query" in the Queries section of the sidebar, or use the creation button inside a report.
- Name
- Unique identifier for the query. Cannot be repeated within the same company. Descriptive names without spaces are recommended (e.g.,
Monthly_Sales,Dim_Product). - Description
- Optional text describing the query's purpose. Visible in the detail panel.
- Steps
- Optionally, you can create the query with initial steps. If not, it's created empty and steps are added later.
Steps
Each query is composed of one or more ordered steps. Each step is an independent M expression that can reference previous steps.
Step fields
- nombre_paso (step name)
-
Name of the step. If it contains spaces, hyphens, accents, or starts with a number, Power Query requires quoting with
#"Step Name".Valid examples:
Source,FilterRows,#"Filter Rows",#"Step-2" - codigo_paso (step code)
-
M expression for the step. Never starts with
StepName =— the system adds that automatically when generating the let/in block.Correct example:
Table.SelectRows(Source, each [Sales] > 0)Incorrect example:
FilterRows = Table.SelectRows(Source, each [Sales] > 0) - es_output (is output)
- Marks the step as the query's final output. Exactly one step must have
es_output = 1per version. This step is used in theinclause of the generated let/in block. - notas (notes)
- Free text to document the step's purpose. Does not affect generated code.
Adding, modifying, and deleting steps
Steps are managed from the "Steps" tab in the query detail panel. The "+ Add step" button offers four options:
- Manual step: specify name, M code, position (order), and whether it's the output.
- DW step: create a SQL query on DW tables and auto-generate M connection steps.
- Paste M code: paste a complete
let ... inblock and replace all query steps. - Create with AI assistant: open the AI chat to generate steps using natural language.
- Modify step: when editing a step, changes go to the draft (created automatically if it doesn't exist).
- Delete step: removes the step from the current draft.
#"OldName" references in other steps of the same draft.
Paste complete M code
This option is useful when you've been working on M code directly in Power Query (where you can see live results) and want to sync it back to {M}aker.
- Copy the complete
let ... inblock from Power Query's Advanced Editor. - In {M}aker, select the target query and click "+ Add step" → "Paste M code".
- Paste the code in the textarea and click "Parse".
- The system shows a preview with detected steps, which one is the output, and warnings for external references.
- Click "Replace steps" to confirm.
#"Name" references that are not steps within the query itself, the system detects them and shows a warning. These references may be to other queries in the same report (which work inside Expression.Evaluate) or queries that should be rewritten as mmaker("name", true, true).
Versioning system
{M}aker implements an immutable versioning system with drafts:
- version_activa (active version)
- The official version in use. This is what Power BI downloads on data refresh. Previous versions are immutable: once activated, their steps cannot be modified.
- version_borrador (draft version)
- Working version where changes accumulate. Can be
NULLif there is no active draft. When any step is modified, a draft is automatically created if one doesn't exist.
Typical workflow
- You start from the active version (e.g., version 3).
- When editing a step, a draft is automatically created (version 4).
- More changes are made: all go to the draft (version 4).
- When everything is ready, you activate the draft → version 4 becomes the active version.
- Power BI will download version 4 on the next refresh.
Activate draft
Converts the draft into the new active version. You can optionally add a change description. Once activated, that version's steps become immutable.
Discard draft
Deletes the draft and all its changes. The active version is not modified.
Rollback
Changes version_activa to any previous version. Does not delete versions — it simply points to a different one. Useful for quickly reverting problematic changes.
mmaker("query_name", false, true) (second parameter false) to load the draft instead of the active version. This lets you test changes before activating them.
Placeholders (parameters)
Steps can use placeholders with the syntax {{PARAM_NAME}} in M code. These placeholders are substituted with concrete values when the query is served in the context of a report.
Format rules
- Double braces:
{{and}} - Only uppercase letters, numbers, and underscores
- Valid examples:
{{COMPANY_ID}},{{FISCAL_YEAR}},{{SERVER_2}} - Invalid examples:
{{company_id}},{{year}},{{my param}}
How they resolve
Each query assigned to a report can have configured values for its placeholders. When serving M code via the codigo_m_report endpoint, the system substitutes each {{PARAM}} with the value configured in that report (or token).
Placeholder change detection
When activating a new version, if placeholders have changed compared to the previous version (added or removed), the system notifies and allows resolving the changes for each affected report.
References between queries
Inside Expression.Evaluate, normal Power Query references (#"Other Query") resolve as null. For a query to reference another {M}aker query, use the launcher function:
mmaker("other_query_name", true, true)
This downloads and executes the other query in the same refresh. The result can be used like any M table or value.
Usage example
// Step "Source" of query "Sales_With_Products"
let
Sales = mmaker("Sales_Raw", true, true),
Products = mmaker("Dim_Product", true, true),
Result = Table.NestedJoin(Sales, "ProductID", Products, "ID", "Product", JoinKind.LeftOuter)
in
Result
let/in block, it must be wrapped in parentheses: (let ... in result). This is an M syntax rule when a let/in is inside another block.
Quick invocation
In each query's detail panel, next to the title, there's a button to copy the invocation to the clipboard:
let Source = mmaker("query_name", true, true) in Source
Critical M code rules
When writing steps in {M}aker, keep these mandatory rules in mind:
| Rule | Correct | Incorrect |
|---|---|---|
Code never starts with StepName = |
Table.FromRows(...) |
Source = Table.FromRows(...) |
| Nested let/in in parentheses | (let x = 1 in x) |
let x = 1 in x (inside another step) |
Quoting with #"Name" for special characters |
#"Filter Rows" |
Filter Rows (without quoting) |
| Exactly 1 output step per version | One step with es_output = 1 |
Zero or multiple outputs |
| No wrapping single quotes | Table.FromRows(...) |
'Table.FromRows(...)' |
| Windows paths with double backslash | "C:\\Data\\file.xlsx" |
"C:\Data\file.xlsx" |
| Real characters, not Unicode escapes | "Information" |
"Informaci\u00f3n" |
Broken references
When a query references another via mmaker("query_name") and that query doesn't exist, it's considered a broken reference.
- In the sidebar, queries with broken references show a warning badge ⚠.
- In the detail panel, a banner appears with the list of broken references.
- Broken references don't prevent operation, but will cause errors in Power BI when trying to resolve the referenced query.
Renaming queries
When renaming a query, the system automatically detects if other queries reference it with mmaker("old_name"). If there are dependencies, it offers two options:
- Auto-update references: the system corrects
mmaker("old_name")tommaker("new_name")in all referencing queries. - Manual correction: the query is renamed and the list of affected queries is shown for manual correction.
M Code tab
The "Codigo M" (M Code) tab in the detail panel shows the let/in block generated from the active version's steps. This is the exact code that Power BI will download when invoking the query.
If the query is viewed from a report context (clicking it from a report's child node), the code shows placeholders substituted with the values configured in that report. If viewed directly from the Queries section in the sidebar, placeholders appear unsubstituted.
Reports tab
The "Reports" tab shows the list of reports containing this query, whether assigned directly or through a pack. This lets you quickly see where each query is used.
Step emulator
The emulator lets you see how each step transforms data, without needing Power BI open. It's integrated into the Steps view:
- In the top bar of the Steps view, upload a file with "Upload Excel/CSV" or paste JSON with "Paste JSON".
- Select the start step (the step whose output the uploaded data represents).
- Each step the emulator can process shows a badge with the resulting row count.
- Click a step to see its result table below the step list.
mmaker("query_name", true, true, "StepName") in Power BI to get a table with the first 50 rows of an intermediate step. Copy the resulting JSON and paste it with "Paste JSON". This is useful for queries connected to databases, APIs, or SharePoint that the emulator cannot simulate directly.
Reports
A report in {M}aker is a grouping of queries with an access token that allows Power BI to download and execute M code. Each report represents a Power BI report (or group of reports) that share the same set of queries and parameters.
Creating a report
Click "+ Report" in the Reports section of the sidebar.
- Name
- Unique identifier for the report. Serves as a visual reference — it's not used in M code.
- Description
- Optional text describing the report's purpose or which Power BI file it's associated with.
- Token
- Auto-generated when creating the report (format
mk_xxx...). This token is used in the Power BI launcher function to authenticate requests. It can be regenerated at any time from the interface.
Importing queries when creating the report (optional)
The "New report" modal includes a selector in the import section with two ways to populate the report with existing queries:
- Paste M code
- Paste a
let ... inblock (or several, prefixed with// QueryName). The system detects steps, assigns names and rewrites cross-references#"Other Query"tommaker("other_query", true, true). - Load dataflow JSON
- Upload the file exported from Power BI Service (Dataflow → Export) or paste its content. See the Import Power BI dataflow section below.
If the import fails after creating the report, the system automatically deletes the created report (rollback) to avoid inconsistent state.
Import Power BI dataflow
Allows bulk transfer of a Power BI Service dataflow into {M}aker queries in a single operation. Available in two places:
- When creating a report, choosing "Load dataflow JSON" in the new report modal (creates the report and assigns queries in one step).
- In an existing report, from the dropdown "+ Add query" → "Import dataflow (JSON)".
A standalone third option exists (without a report), but converting parameters to {{placeholders}} requires a target report.
What the importer does
- Reads the dataflow JSON and extracts all queries (
section Section1; shared X = let ... in X;), groups (folders) and metadata. - Classifies each query as table, parameter (has
meta [IsParameterQuery = true]) or function ((args) as type => ...). - Rewrites cross-references (
#"Other Query"or bare names likeStartDate) tommaker("other_query", true, true)so they work inside the launcher'sExpression.Evaluate. - Detects conflicts with existing queries in the company and duplicates within the batch itself (e.g. when two different names like
aux FestivosMadridandaux_FestivosMadridcollide after sanitizing). - Shows an editable preview with checkbox per row, renamable final name and warnings.
Preview and options
- Conflict policy
-
Rename (default): applies automatic suffix
_2,_3... to colliding queries while keeping refs consistent.
Skip: does not import queries that already exist in DB.
Overwrite: creates a new active version for queries that already exist. - Final name (editable per row)
- You can manually change the proposed name before importing. References
mmaker("original_name", ...)in other queries of the batch are automatically rewritten to the name you pick. - Create pack per group
- If the dataflow has groups (folders like PARAMETERS, FUNCTIONS, DIMENSIONS), creates one pack per group with the corresponding queries and assigns it to the report.
- Assign to active report
- Only visible in the dropdown flow (in the new report modal this is implicit).
- Convert PQ parameters to
{{placeholders}} - Active by default when there's a target report. See the next section.
Converting parameters to mmaker placeholders
Power Query parameters (queries with meta [IsParameterQuery = true] like SV = "52.236.82.20" or StartDate = #date(2000, 1, 1)) are constant values, not processes. Creating them as {M}aker queries would add an unnecessary HTTP round-trip and break the multi-token/RLS model where each token can have its own value.
When the option is active, the importer:
- Does not create a query for the selected parameters.
- Rewrites refs in the other batch steps:
mmaker("SV", true, true)→{{SV}}. - Adds entries to
report_paramswithnombre_placeholder=SVandvalor="52.236.82.20"(the literal value with quotes / M functions intact, for direct textual substitution in the generated M code).
The visual indicator on parameter rows shows → {{NAME}} so you see before confirming what will happen to each one.
mmaker("SV", true, true), the importer does not modify it. The user's previous decision is preserved.
Assigning queries
A report can contain queries in two ways:
Direct assignment
From the report's "Estructura" (Structure) tab, use the "Add query" button to select existing queries. Each directly assigned query can have an optional alias — an alternative name shown in the interface without affecting the code.
Via packs
From the same tab, you can assign packs to the report. The report automatically inherits all queries from the pack. See the Packs section for more details.
Parameters (placeholders)
If queries assigned to the report contain placeholders ({{PARAM}}), they must be configured with concrete values.
Parameter configuration
From the "Estructura" (Structure) tab, each query shows its pending placeholders. Clicking a query opens the parameter editor where values are entered.
| Concept | Description |
|---|---|
| Placeholder | Variable in M code with format {{NAME}}. Automatically detected. |
| Value | Text that replaces the placeholder when serving code. Can be a number, text, path, etc. |
| Status | Visually indicates whether a placeholder has a configured value or is pending. |
codigo_m_report endpoint returns HTTP 422 and Power BI will show an error on refresh. Make sure to configure all parameters before using the report in production.
Multi-token system (parameter RLS)
In addition to the report's main token (legacy token), {M}aker supports creating multiple access tokens per report, each with its own parameter values.
Use case
Imagine a report with a query that filters data by company using {{COMPANY_ID}}. With multi-token you can:
- Create a token "Company A" with
COMPANY_ID = 1 - Create a token "Company B" with
COMPANY_ID = 2 - Create a token "All" with
COMPANY_ID = 0
Each Power BI user uses a different token and gets different data, all with the same queries.
Token management
Tokens are managed from the report's "Accesos" (Access) tab:
- Create token
- Specify a descriptive name and optionally a description. The token string is auto-generated.
- Configure parameters
- Each token has its own set of values for the query placeholders. Values are configured independently per token.
- Duplicate token
- Creates a copy of an existing token with all its parameters. Useful for creating variants with small differences.
- Regenerate token
- Generates a new token string (invalidates the previous one). Useful if a token has been compromised.
- Toggle active/inactive
- Temporarily deactivates a token without deleting it. An inactive token does not serve M code — Power BI will receive an error.
- Delete token
- Permanently deletes the token and all its configured parameters.
report_params): one value per placeholder, shared by all queries of the report. Access tokens can have their own overrides in report_token_params. If two concepts need different values, use different names (e.g. CURRENT_YEAR vs PREVIOUS_YEAR), not the same name with two values.
Substitution in Power Query M vs DW SQL
The same {{PARAM}} substitutes in two different contexts with different rules:
| Power Query M | DW SQL (dw_consultas) | |
|---|---|---|
| Substitution type | Textual (no quotes) | Auto-quoted (PDO::quote) |
| String | "{{REGION}}" — manual quotes | {{REGION}} — no quotes |
| Number | {{N}} | {{N}} — MySQL coerces |
| LIMIT / OFFSET | — | Not supported (requires int literal, rejected by PDO::quote) |
| Security | Designer's responsibility | SQL injection prevented via quote |
- M (.pbix): you control the quotes based on the type
- SQL (dw_consultas): never put quotes around
{{PARAM}}
Example: same REGION parameter in both contexts
// Power Query M (filter step)
= Table.SelectRows(Data, each [region] = "{{REGION}}")
-- DW SQL (named query)
SELECT * FROM dw_1_sales WHERE region = {{REGION}}
Special case: dynamic LIMIT
Auto-quoting prevents using LIMIT {{N}} because MySQL requires an integer literal. Alternative: hardcode in the query (LIMIT 1000) or use per_page in the HTTP call.
Placeholder detection in the report panel
The Launcher tab's parameter panel automatically detects all placeholders used by the report's queries. Two key behaviors:
- Placeholders in DW consultas: if a Power Query step invokes a DW query (
dw_sql), the system also scans that query's SQL and adds its{{PARAM}}to the panel. Configure the value once and it applies in both places (M + SQL). - Draft vs active: if a query has a draft, placeholders from the draft are used. This lets you configure and test new parameters while developing, without having to activate the version first.
{{PARAM}} with a dummy value before LIMIT 0. You can save queries with parameters without needing configured values.
Launcher tab
The "PQ Queries" (or "Launcher") tab shows the M code for the launcher function that must be created in Power BI to connect with this report.
The mmaker() function
The launcher is a Power Query function with three parameters:
- NombreQuery (text)
- Name of the query to download from {M}aker. Must exactly match the registered name.
- Version (logical)
true= active version (published),false= draft (in development). Appears as a dropdown in Power BI thanks toDocumentation.AllowedValues.- Evaluar (logical)
true= executes the downloaded M code,false= shows the code as text without executing (debug mode). Also appears as a dropdown in Power BI.
Launcher structure
let
FnType = type function (
NombreQuery as (type text meta [
Documentation.Description = "Query name in {M}aker"
]),
Version as (type logical meta [
Documentation.Description = "true = active; false = draft",
Documentation.AllowedValues = {true, false},
Documentation.DefaultValue = true
]),
Evaluar as (type logical meta [
Documentation.Description = "true = execute; false = show code",
Documentation.AllowedValues = {true, false},
Documentation.DefaultValue = true
])
) as any meta [
Documentation.Name = "mmaker"
],
Fn = (NombreQuery as text, Version as logical, Evaluar as logical) =>
let
Token = "mk_your_token_here",
BaseUrl = "https://your-server/mmaker/api.php",
Response = Text.FromBinary(
Web.Contents(BaseUrl, [
Query = [
action = "codigo_m_report",
token = Token,
query = NombreQuery,
v = if Version then "activa" else "borrador"
]
])
),
Result = if Evaluar then
Expression.Evaluate(Response, #shared)
else
Response
in
Result
in
Value.ReplaceType(Fn, FnType)
Usage from Power BI
Once the mmaker function is created, each query in the report is invoked like this:
// In a new blank query:
mmaker("Monthly_Sales", true, true)
Or in full step format:
let
Source = mmaker("Monthly_Sales", true, true)
in
Source
Parameters as dropdowns in Power BI
Thanks to Documentation.AllowedValues = {true, false}, Power BI shows the Version and Evaluar parameters as dropdowns in the invocation interface. Documentation.DefaultValue pre-fills the default values.
DW tables in the launcher
If the company has tables in the DW (Data Warehouse) module, the launcher tab also shows a "DW Tables (API)" section with copyable M code for each table.
These tables are accessed via Web.Contents to the dw_data endpoint, using the same report token. The generated M code includes:
- Automatic pagination with
List.Generatefor large tables. - Automatic type conversion (
Table.TransformColumnTypes) based on column types. - Exclusion of internal columns (
_dw_*) by default.
For each table, there's a "Copy M" button that copies the code ready to paste in Power BI as a blank query.
Status tab
The "Estado" (Status) tab shows a report status summary:
- Number of assigned queries (direct and via packs).
- Parameters pending configuration.
- Active and inactive tokens.
Deleting and renaming reports
Delete: Deletes the report, all its tokens, and parameter configurations. Queries are not deleted — they continue to exist as independent resources.
Rename: Changes the report name. Does not affect tokens or Power BI operation (the token is the real identifier, not the name).
Packs
A pack in {M}aker is a reusable group of queries that can be assigned to multiple reports. Packs allow sharing a common set of queries across several Power BI reports without assigning them one by one.
Typical use case
In most Power BI projects, there are queries that repeat across many reports:
- Dimension tables: dates, products, customers, regions.
- Helper functions: common transformations, data cleaning.
- Base connections: queries that establish connection to a shared data source.
Instead of assigning these queries individually to each report, they are grouped in a pack (e.g., "Common Dimensions") and the pack is assigned to each report that needs it.
Creating a pack
Click "+ Pack" in the Packs section of the sidebar.
- Name
- Unique identifier for the pack. A descriptive name of the query group it contains is recommended (e.g., "Common Dimensions", "SAP Connections", "ETL Utilities").
- Description
- Optional text explaining the pack's purpose and what type of queries it groups.
Managing pack queries
Adding queries
From the "Queries" tab in the pack's detail panel, use the "Add query" button to select existing queries. A list of available queries (those not already in the pack) is shown.
Query order
Queries within a pack have a defined order. The order determines the position in which they appear in the interface. You can reorganize queries by dragging or changing their position.
mmaker("name", true, true). The order is purely organizational within the {M}aker interface.
Removing queries from the pack
To remove a query from a pack, use the unassign button next to each query in the list. This does not delete the query — it only unlinks it from the pack. The query continues to exist as an independent resource.
mmaker("name"), it will receive a 403 error on the next refresh (unless the query is assigned directly to the report).
Assigning packs to reports
Packs are assigned to reports from the report's "Estructura" (Structure) tab (see the Reports section). When assigning a pack, the report inherits all the pack's queries.
Dynamic inheritance
The relationship is dynamic: if queries are added to or removed from the pack after assignment, the report reflects the changes automatically. No need to reassign the pack.
Duplicate queries
If a query is assigned both directly to the report and through a pack, there is no conflict. The server serves it regardless. Parameters are resolved the same way.
Parameters in pack queries
Parameter values ({{PARAM}}) for pack queries are configured at the report level, not at the pack level.
Example
Suppose a "Dimensions" pack with the query "Dim_Company" that uses {{DB_SERVER}}:
| Report | Assigned pack | Value of {{DB_SERVER}} |
|---|---|---|
| Production Report | Dimensions | srv-prod.company.com |
| Development Report | Dimensions | srv-dev.company.com |
| UAT Report | Dimensions | srv-uat.company.com |
All three reports share the same query from the pack, but each substitutes the placeholder with its own server.
Usage tab
The "Uso" (Usage) tab in the pack's detail panel shows the list of reports that have this pack assigned. It lets you see at a glance where the pack is used and evaluate the impact of any change.
Deleting a pack
When deleting a pack:
- It is unlinked from all reports that used it.
- The pack's queries are not deleted — they continue to exist as independent resources.
- Reports that used the pack lose access to those queries (through the pack). If they still need them, they must be assigned directly.
Renaming a pack
You can rename a pack using the edit button next to the title. Renaming does not affect assignments or functionality — it is purely a visual name change.
Best practices
- Group by functional domain
- Create packs that represent a logical domain: "Dimensions", "ERP Connections", "Utilities". Avoid generic packs like "Common queries" that grow without control.
- One pack, one purpose
- It's better to have several small, specific packs than one large one with everything. This makes selective assignment to reports easier.
- Document with the description
- Use the pack's description to explain what it contains and when it should be used. This helps other configurators decide whether to assign the pack to their reports.
- Review the impact
- Before modifying a pack's queries, review the "Usage" tab to know how many reports will be affected.
Pipelines
A pipeline in {M}aker is a reusable process configuration that defines how to parse a file type, which columns to extract, what validations to apply, and what actions to execute after loading. It is the "blueprint" of the process: it defines the how, but not the where.
dw_{empresa_id}_{nombre_tabla}) and executes its assigned pipeline. Multiple bloques can share the same pipeline.
Creating a pipeline
Click "+ Pipeline" in the Pipelines section of the sidebar. A 3-step wizard opens.
Step 1 — Basic data and sample file
- Name
- Unique identifier for the pipeline within the company. Should be descriptive of the file type or process it manages (e.g., "Monthly Sales", "CSV Stock Load").
- Description
- Optional free text documenting the purpose of the pipeline.
- Sample file
- An Excel (.xlsx, .xls) or CSV file used as a template for column detection and structure. The system reads the headers and offers type autodetection.
- "No file" toggle
- Enable this toggle to create a pipeline that does not process files. Used for action pipelines (BPM): they only execute pipeline steps without inserting data into a table. When enabled, the file selector disappears and step 3 auto-generates fixed columns from the upload fields.
file) automatically generates a fixed column with campo_carga_ref linked. The table is built entirely from fixed values. The load process is equivalent to "adding a row" by filling out the upload fields, without uploading any file.
Step 2 — Upload fields
Upload fields are forms that the user fills in when uploading a file (or when executing a no-file pipeline). See the Upload fields section for full details on types, SQL options, groups and conditions.
Step 3 — Structure
Defines the destination table structure and how to map file data to database columns.
Destination table
- Table name
- Internal name of the dynamic table to be created in
mmaker_dw. The final name will bedw_{empresa_id}_{table_name}. Only letters, numbers and underscores allowed. Cannot be changed after creation. - Header row
- Row number in the Excel file containing column names. Defaults to
1. - Data row
- Row number where data begins. Defaults to
2. If the file has metadata rows between the header and data, adjust this value.
nombre_tabla field can be left empty. In that case no dynamic table is created and the pipeline only executes its post-load steps.
Data columns
Each column defines a mapping between a source file column and a destination table field.
| Field | Description |
|---|---|
nombre_origen |
Column name as it appears in the source file header. Must match exactly (case-sensitive). |
nombre_campo |
Column name in the destination MySQL table. Only letters, numbers and underscores. |
tipo_dato |
MySQL data type: varchar, int, decimal, date, datetime, text. |
longitud |
Maximum field length. Defaults to 255 for varchar. For decimal, this is the total precision (e.g., 10 in DECIMAL(10,2)). |
decimales |
Only for decimal type. Number of decimal places (e.g., 2 in DECIMAL(10,2)). |
formato_fecha |
Dual use depending on data type:
|
orden |
Relative position of the column in the table. Determines column order in the UI and during table creation. |
1.234,56 (dot for thousands, comma for decimals), set eu in the formato_fecha field of int or decimal columns. The parser will automatically convert to standard MySQL format.
Globals (fixed cells from file)
Globals extract values from fixed cells in the Excel file (not from the tabular data zone). They are useful for metadata that appears at a fixed position in the file (e.g., reporting month in cell B1, year in cell C1).
| Field | Description |
|---|---|
nombre_campo |
Column name in the destination table where the value will be stored. |
fila |
Row number of the cell (1-based). |
columna |
Column number of the cell (1-based, where A=1, B=2, etc.). |
tipo_dato |
varchar, int, decimal or date. |
The value extracted from the global cell is repeated in every row inserted from that load. It acts as a constant that comes from the file itself.
Fixed values (Fijas)
Fixed values assign a constant value to a column for all rows in each load. Unlike globals, the value does not come from the file but from the configuration.
| Field | Description |
|---|---|
nombre_campo |
Column name in the destination table. |
valor |
Literal value, SQL expression (e.g., NOW(), CURDATE()) or pipeline variable (e.g., {{_DW_CARGA_ID}}). Evaluated at insertion time. |
campo_carga_ref |
If enabled, the fixed value is taken from the indicated upload field instead of the literal value. The UI provides a toggle to switch between literal value and upload field reference. |
tipo_dato |
varchar, int, decimal or date. |
campo_carga_ref pointing to the upload field name.
Singularity (Keys)
The singularity (keys) system controls data deduplication. Before inserting new rows, the system deletes existing rows that match on all configured key fields. If no keys are configured, data simply accumulates (append only).
| Key type | Value source | Examples |
|---|---|---|
columna |
Data from the file (mapped column) | producto, fecha, codigo |
global |
Fixed cell from the file (globals) | ANIO, MES |
interno |
Internal DW table field | _dw_bloque_id, _dw_fichero, _dw_hoja_idx, _dw_hoja_nombre |
campo_carga |
Field filled by the user during upload | Resolved via the fixed column that has campo_carga_ref pointing to the field |
_dw_bloque_id as an internal key. When enabled, loads from one bloque only affect (delete/replace) data from that same bloque, never from other bloques sharing the same table.
Required (mandatory fields)
Marks columns that must have a value in each row. Rows where a required field is empty are rejected as errors and recorded in dw_carga_errores. Valid rows are inserted normally.
Pipeline without table
Since migration 037, the nombre_tabla field in dw_pipelines is nullable. A pipeline without a table:
- Does not create a dynamic table in
mmaker_dw. - Does not execute data INSERT.
- Only executes post-load steps (validations, SQL, variables, mailing, triggers, BPM states).
Typical use cases:
- BPM actions: Change the state of a load in the Kanban board.
- Automated mailing: Send emails as an action on an existing load.
- Chained triggers: Execute other pipelines in response to an action.
- Standalone validations: Check data without modifying the table.
dw_guardar_pipeline_config endpoint skips CREATE/ALTER table operations on the dynamic table.
Multi-sheet (config_hojas)
For Excel files with multiple sheets, the pipeline can configure which sheets to process and whether they share the same structure.
- "nombres" mode
- Identifies sheets by their exact name. Useful when the file always has a sheet called "Datos" among other variable sheets.
- "indices" mode
- Identifies sheets by their position (0-based). Useful when the sheet name changes (e.g., the month name) but it is always at the same position.
misma_estructura- If
true, all selected sheets share the same column configuration. Iffalse, each sheet can have its own independent column mapping.
The internal columns _dw_hoja_idx and _dw_hoja_nombre are automatically populated with the sheet index and name for each row. They can be used as singularity keys (type interno).
Editing an existing pipeline
From the pipeline detail panel (Structure tab), click "Edit configuration". This opens the DW wizard in edit mode:
- The wizard jumps directly to step 2 (upload fields), pre-populated with the current configuration.
- The "Destination table" field is read-only — the dynamic table cannot be renamed once created.
- When saved,
dw_actualizar_pipeline+dw_guardar_pipeline_configare called, applying changes and executing ALTER TABLE if needed (adding new columns, modifying types).
int).
Sharing a pipeline across bloques
A pipeline can be assigned to multiple bloques. Each bloque using the same pipeline:
- Shares the same column configuration, globals, fixed values, keys and upload fields.
- Has its own destination table (unique name per bloque).
- Executes the same post-load steps.
To assign a pipeline to a bloque, use the "Change" button in the bloque panel header, or the dw_asignar_pipeline_bloque endpoint.
bloque.pipeline_id ?? app.pipeline_id ?? null. If the bloque has its own pipeline, that one is used. Otherwise, it inherits the pipeline from the containing app. If neither is defined, the bloque uses its legacy configuration (dw_bloque_* tables).
Deleting a pipeline
A pipeline can only be deleted if it has no assigned bloques. If there are bloques referencing the pipeline, the system prevents deletion and shows an error. You must reassign or delete the linked bloques before you can delete the pipeline.
Post-load steps
Pipelines can include steps that execute automatically after data insertion. Available step types are documented in detail in the Pipeline steps section. Types include: validations (stop/alarm), SQL, variables, mailing, triggers, loops, result tables, flyouts and BPM states.
Pipeline structure summary
| Component | Table | Function |
|---|---|---|
| Columns | dw_pipeline_columnas |
File-to-table mapping (nombre_origen to nombre_campo + type) |
| Globals | dw_pipeline_globals |
Fixed cells from the file (row + column to field) |
| Fixed values | dw_pipeline_fijas |
Constant values or upload field references |
| Keys | dw_pipeline_keys |
Singularity fields (deduplication) |
| Required | dw_pipeline_required |
Mandatory fields per row |
| Upload fields | dw_pipeline_campos_carga |
Form filled by the user during upload |
| Steps | dw_pipeline_pasos |
Post-load actions (validation, SQL, mailing, etc.) |
Blocks
A block is an instance with its own identity within the DW module. Each block represents a concrete data destination: it has a company, a name, and a unique dynamic table in the mmaker_dw database. The combination empresa_id + nombre_tabla generates the table dw_{empresa_id}_{nombre_tabla}.
While a pipeline defines how a file is processed (columns, validations, steps), the block defines where the data lands. Multiple blocks can share the same pipeline, but each block has its own table and its own upload history.
Creating a block
To create a block, click "+ Bloque" in the DW section of the sidebar. This opens the DW wizard in block mode with 3 steps:
- Step 1 — Basic data
-
Block name (unique per company), optional description, and a sample file to detect structure. Optionally, you can check "Sin fichero" (No file) if the block will only receive data via upload fields.
- Step 2 — Upload fields
-
Form that the user will fill in when uploading data. Fields of type
input,number,select,date, orfileare defined. See Upload fields section for more detail. - Step 3 — Structure
-
Target table (
nombre_tabla), header row, data row, globals, fixed values, and data columns. This configuration defines the structure of the dynamic table that will be created inmmaker_dw.
nombre_tabla is defined during creation and cannot be changed afterwards. Choose a descriptive lowercase name without spaces (e.g., sales, monthly_stock).
Block fields
| Field | Type | Description |
|---|---|---|
nombre |
VARCHAR(100) | Visible block name (unique per company) |
nombre_tabla |
VARCHAR(100) | Dynamic table name (immutable after creation) |
descripcion |
TEXT | Optional description |
pipeline_id |
INT FK | Assigned pipeline that defines the process configuration |
app_id |
INT FK | Container app (Phase 2). Can be NULL for standalone blocks |
fila_cabecera |
INT | File row containing headers (default: 1) |
fila_datos |
INT | First data row (default: 2) |
config_hojas |
JSON | Multi-sheet configuration (name/index mode, selected sheets) |
fichero_master |
VARCHAR(255) | Internal name of the reference master file |
expectativa_carga |
JSON | Expected upload frequency/calendar |
Pipeline assignment
A block obtains its process configuration (columns, globals, fixed values, keys, required, upload fields, steps) from a pipeline. Resolution follows this hierarchy:
effective pipeline = block.pipeline_id ?? app.pipeline_id ?? null
- block.pipeline_id
- If the block has a directly assigned pipeline, that one is used (override).
- app.pipeline_id
- If the block has no own pipeline but belongs to an app with a pipeline, it inherits the app's pipeline (fallback).
- null (no pipeline)
- If there is no pipeline at either level, the block uses its own configuration (legacy mode). See next section.
In the block detail panel, the header shows the assigned pipeline with a link to the pipeline and a "Cambiar" (Change) button that opens a modal with a selector of available pipelines.
Legacy mode (no pipeline)
If a block has no assigned pipeline (neither direct nor via app), it uses its own configuration stored in the dw_bloque_* tables:
dw_bloque_columnas— data columnsdw_bloque_globals— fixed file cellsdw_bloque_fijas— constant valuesdw_bloque_keys— singularity keysdw_bloque_required— required fieldsdw_bloque_campos_carga— upload form fields
In this mode, the Estructura (Structure) tab shows the full configuration and allows editing it via the "Edit configuration" button.
Dynamic table
When creating or saving a block's configuration, the system generates (or alters) a table in the mmaker_dw database named dw_{empresa_id}_{nombre_tabla}.
Automatic internal columns
Every dynamic table includes these internal columns, managed automatically by the system:
| Column | Type | Description |
|---|---|---|
_dw_id |
INT AUTO_INCREMENT PK | Unique row identifier |
_dw_carga_id |
INT | ID of the upload that inserted this row |
_dw_bloque_id |
INT | Source block ID |
_dw_linea |
INT | Line number in the original file |
_dw_fichero |
VARCHAR(255) | Name of the uploaded file |
_dw_hoja_idx |
INT | Sheet index (NULL for CSV) |
_dw_hoja_nombre |
VARCHAR(255) | Excel sheet name |
_dw_timestamp |
DATETIME | Insertion timestamp |
After the internal columns, user-defined columns are added: first globals, then fixed values, and finally data columns from the file.
_dw_bloque_id, _dw_fichero, _dw_hoja_idx, and _dw_hoja_nombre can be used as singularity keys of type interno. This is useful for controlling deduplication granularity.
Block panel tabs
The block detail panel has 5 main tabs:
Structure tab
Shows the block's full configuration: target table, globals, fixed values, columns, keys, and required fields. Allows editing the configuration via the wizard.
Uploads tab (Cargas)
Upload history (last 100 uploads) with the following information per upload:
| Data | Description |
|---|---|
| File name | Original name of the uploaded file |
| Status | ok, error, procesando (processing), or cancelado (cancelled) |
| BPM Status | Current Kanban state (if applicable) |
| Rows OK / Error | Count of inserted vs rejected rows |
| Date | Upload start and end time |
| User | Who performed the upload |
Expanding an upload's detail shows:
- Available actions: BPM action buttons filtered by the upload's current
estado_bpm. - Upload field values: the values the user filled in when uploading.
- Result tables: tables generated by
tablatype pipeline steps. - Flyouts: files generated by
flyouttype pipeline steps, with download button. - Errors: rejected rows with line number, reason, and JSON data.
- Execution log: detailed step-by-step pipeline log.
- Child uploads: uploads generated by BPM actions on this upload.
Data tab (Datos)
Paginated table with the contents of the dynamic table dw_{empresa_id}_{nombre_tabla}. Shows all columns (internal and user-defined) with server-side pagination.
View tab (Vista)
Contains two sub-tabs:
- Kanban
- Drag & drop board where columns are the configured states and cards are uploads with the corresponding
estado_bpm. Requires the block to have Kanban states configured. See Kanban / BPM section. - Public form
- Public upload form configuration for external users. See Public forms section.
Actions tab (Acciones)
CRUD for BPM actions available on the block's uploads. Each action links a pipeline that runs on an existing upload. See Kanban / BPM section for full detail.
| Field | Description |
|---|---|
nombre | Visible action name (e.g., "Approve", "Reject") |
pipeline_id | Pipeline to execute on the upload |
icono | Optional icon (emoji) |
estado_origen | Only visible when the upload is in this state (NULL = always visible) |
Upload flow
The data upload process to a block follows 4 steps:
Step 1 — Upload fields
A modal opens with the upload fields defined in the pipeline/block. If field groups are configured, the modal works as a multi-step wizard:
- The first visible group is shown (based on conditions).
- The user fills in the fields and clicks Continue.
- The next group's condition is evaluated (
siempre,valor_igual,valor_diferente,sql). - If the group is visible, it's shown; otherwise, it's skipped to the next one.
- After all groups, a summary of filled values is shown.
If no groups are configured (legacy mode), all fields are shown together in a single step.
Step 2 — File selector
The user selects the Excel (.xlsx, .xls) or CSV file to upload. The file is uploaded to the server and stored in uploads/tmp/.
Step 3 — Preview
The system parses the file according to the configuration (header row, data row, sheets) and shows the first 20 rows in a preview table. The user can verify that column mapping is correct before confirming.
Step 4 — Confirmation
Upon confirmation, the system executes the following sequence:
- Singularity delete: if singularity keys are configured, existing rows matching all key fields are deleted.
- Insert: valid rows are inserted into the dynamic table, applying type conversions and verifying required fields.
- Pipeline: the post-upload pipeline runs (validations, SQL, variables, mailing, etc.).
- Log: errors (rejected rows) and pipeline results are recorded.
- Initial BPM state: if the block has Kanban with
es_inicial=1state, it's assigned automatically.
The file is moved from uploads/tmp/ to uploads/procesados/.
validacion_stop step finds rows violating the condition, a full rollback is performed: inserted data is deleted and pipeline SQL operations are undone. The upload is marked with error status.
Execution without file
A block can execute its pipeline without uploading a file, using the "Ejecutar pipeline" (Execute pipeline) button in the Uploads tab. This is useful for pipelines that only need upload fields (no file data).
The flow:
- A modal with upload fields is shown (if any).
- On confirmation, an upload is created with
nombre_fichero = '[sin fichero]'. - A single row is inserted into the dynamic table with fixed values (including fixed values with
campo_carga_ref). - The pipeline runs normally.
nombre_tabla (tableless pipeline), no row is inserted — only the pipeline steps are executed. This is typical for BPM action pipelines.
Master file
Each block can have a master file for reference. This file is stored in uploads/masters/ and serves as a template or reference for uploads.
- Upload master
save_masteraction indw_upload.php. Uploaded via FormData and stored associated with the block.- Download master
get_masteraction indw_upload.php. Serves the file as a binary download with ownership verification.- Usage in wizard
- When editing the block/pipeline configuration, the master file can be re-parsed to update column detection.
Singularity (keys)
Singularity keys control data deduplication. Before inserting new rows, existing rows matching all defined key fields are deleted.
| Key type | Value source | Example |
|---|---|---|
columna |
File data (mapped column) | product, date |
global |
Fixed file cell (globals) | YEAR, MONTH |
interno |
DW table internal field | _dw_bloque_id, _dw_fichero |
campo_carga |
Field filled by user on upload | Resolved via campo_carga_ref in the fixed value |
_dw_bloque_id. When activated, each upload replaces all previous data for that block (full replacement behavior).
Deleting a block
When deleting a block:
- The block record is deleted from
dw_bloques. DROP TABLEis executed on the dynamic tabledw_{empresa_id}_{nombre_tabla}inmmaker_dw.- Cascading deletes remove: uploads, errors, logs, upload fields, actions, Kanban states, transitions, and bricks.
Related endpoints
GET
| Endpoint | Params | Description |
|---|---|---|
dw_bloques | — | List blocks with num_columnas, num_cargas |
dw_bloque_detalle | bloque_id | Full config: columns, globals, fixed, keys, required |
dw_cargas | bloque_id | Upload history (last 100) |
dw_carga_log | carga_id | Pipeline execution log |
dw_carga_errores | carga_id | Rejected rows with reason |
dw_datos | bloque_id, page?, per_page? | Paginated dynamic table data |
POST
| Action | Key fields | Description |
|---|---|---|
dw_crear_bloque | nombre, nombre_tabla?, descripcion? | Create DW block |
dw_actualizar_bloque | bloque_id, nombre?, descripcion? | Update name/description |
dw_eliminar_bloque | bloque_id | Delete block + DROP table |
dw_guardar_config | bloque_id, columnas[], etc. | Save full config + CREATE/ALTER table |
dw_asignar_pipeline_bloque | bloque_id, pipeline_id | Assign pipeline to block |
dw_mover_bloque_app | bloque_id, app_id | Move block to another app |
dw_upload.php
| Action | Type | Description |
|---|---|---|
preview | FormData | Upload file to tmp, parse, return preview (20 rows) |
confirm | JSON | Singularity delete + insert + pipeline + log |
delete_carga | JSON | Delete upload and its data from the table |
execute_pipeline | JSON | Execute pipeline without file |
save_master | FormData | Save reference master file |
get_master | GET | Download master file |
get_flyout | GET | Download generated flyout file |
Apps
An App is a logical grouping of bloques within the DW module. Its main purpose is to organize related bloques under a single umbrella and, optionally, provide a fallback pipeline that is inherited by all its bloques that do not have their own pipeline assigned.
Effective pipeline (fallback)
The system resolves the pipeline that applies to each bloque using the following cascade logic:
effective pipeline = bloque.pipeline_id ?? app.pipeline_id ?? null
- bloque.pipeline_id
- If the bloque has a pipeline assigned directly, that one is used. It has the highest priority.
- app.pipeline_id
- If the bloque does NOT have its own pipeline, it inherits the pipeline configured on its container app. This is the fallback pipeline.
- null
- If neither the bloque nor the app have a pipeline, the bloque has no process configuration and will not be able to process file uploads automatically.
Creating an app
To create a new app:
- In the DW section of the sidebar, click the "+ App" button (or use the context menu).
- A modal opens with the following fields:
| Field | Required | Description |
|---|---|---|
| Name | Yes | Unique name for the app within the company. Identifies the app in the sidebar and panels. |
| Description | No | Optional descriptive text about the app's purpose. |
| Pipeline | No | Fallback pipeline. Selected from the list of available pipelines in the company. Can be left empty and assigned later. |
- Click Create. The app will appear in the sidebar under the DW section and its detail panel will open.
App panel
When selecting an app in the sidebar, its detail panel is displayed with two main areas:
Header
The header shows:
- The app name (with a rename button on hover).
- Description (if any).
- Pipeline badge: if the app has a fallback pipeline assigned, a badge with the pipeline name appears. Otherwise, it indicates no pipeline is configured.
- Edit (name, description, pipeline) and Delete buttons.
Bloque list
Below the header, all bloques belonging to the app are listed. Each bloque appears as a card with:
- Bloque name.
- Associated dynamic table name.
- Effective pipeline indicator (own or inherited from app).
- "Upload" button that directly opens the file upload modal for that bloque (
selectBloqueDWAndUpload(id)).
Sidebar: Apps → Bloques tree
The DW section of the sidebar shows a hierarchical tree:
DW
+-- App "Sales" [click to view app panel]
| +-- Invoices [click to view bloque panel]
| +-- Returns [click to view bloque panel]
| +-- Credits [click to view bloque panel]
+-- App "HR"
+-- Payroll
+-- Attendance
- Clicking the app name opens its detail panel.
- Clicking the triangle/arrow expands or collapses child bloques without changing the active selection.
- Clicking a bloque opens the bloque detail panel (with its tabs: Structure, Loads, Data, Kanban, etc.).
- The sidebar search bar filters both apps and bloques by name. If a bloque matches the search, its parent app is automatically expanded.
Moving bloques between apps
A bloque can be moved from one app to another using the dw_mover_bloque_app endpoint:
| Parameter | Description |
|---|---|
bloque_id |
ID of the bloque to move. |
app_id |
ID of the destination app. |
pipeline_id = NULL), its effective pipeline will change to the fallback of the new app. This can alter how loads are processed in that bloque. Verify that the new app has a compatible pipeline or assign a direct pipeline to the bloque before moving it.
Deleting an app
To delete an app, use the Delete button in the app panel.
Steps to delete an app that has bloques:
- Move each bloque to another app using
dw_mover_bloque_app. - Alternatively, delete the bloques (this also drops their dynamic tables and all load history).
- Once the app is empty, use
dw_eliminar_app.
Access permissions
The permission system allows granular access control to apps and bloques with two axes:
- App axis (app-level access)
- When granting
dw_apppermission to a user, they inherit access to all bloques in that app. This is the simplest way to grant access when the user needs to see/use the entire app. - Bloque axis (bloque-level access)
- When granting
dw_bloquepermission to a user, they access only that specific bloque, regardless of the app. Useful when a user only needs access to a subset of bloques.
| Permission type | Scope | Use case |
|---|---|---|
dw_app |
All bloques in the app | User who manages the entire area (e.g., all of "Sales") |
dw_bloque |
Only the specific bloque | User who only uploads invoices but not returns |
Permission management is done from the Administration panel (Users section), where you can assign and revoke permissions per user. You can also see which users have access to a specific resource from the Permissions tab in the DW table manager.
Use case examples
Example 1: "Sales" app with shared pipeline
A company receives three types of commercial files with the same structure (columns: product, date, amount, customer):
App "Sales"
pipeline_id = 5 (Pipeline "Standard Sales")
+-- Bloque "Invoices" (pipeline_id = NULL -> inherits Pipeline 5)
+-- Bloque "Returns" (pipeline_id = NULL -> inherits Pipeline 5)
+-- Bloque "Credits" (pipeline_id = NULL -> inherits Pipeline 5)
All three bloques share the same process pipeline. Each one has its own dynamic table (dw_1_invoices, dw_1_returns, dw_1_credits), but the columns, validations, and post-load steps are identical. If you need to change a validation, you change it once in Pipeline 5 and it applies to all three bloques.
Example 2: App with fallback pipeline and override
An app where most bloques use the same process, but one needs a different one:
App "HR Reports"
pipeline_id = 8 (Pipeline "Standard HR")
+-- Bloque "Payroll" (pipeline_id = NULL -> inherits Pipeline 8)
+-- Bloque "Attendance" (pipeline_id = NULL -> inherits Pipeline 8)
+-- Bloque "Evaluations" (pipeline_id = 12 -> uses Pipeline 12, ignores fallback)
Payroll and Attendance inherit the standard pipeline from the app. Evaluations has its own pipeline because the file structure is different (different columns, different validations). There is no need to move Evaluations to another app: simply assign its own pipeline to override the fallback.
Example 3: App as organizational grouping
If you do not need a fallback pipeline, the app functions simply as a visual/organizational grouping:
App "Master Data"
pipeline_id = NULL (no fallback)
+-- Bloque "Products" (pipeline_id = 3)
+-- Bloque "Customers" (pipeline_id = 4)
+-- Bloque "Suppliers" (pipeline_id = 5)
Each bloque has its own pipeline because each master has a different structure. The app only serves to logically group them in the sidebar and simplify permission management (a single dw_app permission grants access to all three bloques).
API endpoints
GET
| Endpoint | Parameters | Description |
|---|---|---|
dw_apps |
— | Lists all accessible apps with num_bloques and pipeline_nombre. |
dw_app_detalle |
app_id |
App detail with its list of bloques. |
POST
| Action | Fields | Description |
|---|---|---|
dw_crear_app |
nombre, descripcion?, pipeline_id? |
Creates a new app. |
dw_actualizar_app |
app_id, nombre?, descripcion?, pipeline_id? |
Updates name, description, or pipeline of the app. |
dw_eliminar_app |
app_id |
Deletes the app (only if it has no bloques). |
dw_mover_bloque_app |
bloque_id, app_id |
Moves a bloque to another app. |
Summary
| Aspect | Detail |
|---|---|
| Main function | Group related bloques and share a pipeline |
| Pipeline fallback | bloque.pipeline_id ?? app.pipeline_id |
| Deletion | Only if the app has no bloques |
| Permissions | App axis (all bloques) or bloque axis (individual) |
| Sidebar | DW tree with expandable/collapsible nodes |
| Unique name | Per company (UNIQUE KEY (empresa_id, nombre)) |
Upload Fields
Upload fields (campos de carga) are form fields that users fill out before or during a file upload to a bloque. They capture contextual information not contained in the file itself: period, client, responsible person, cutoff date, attachments, etc.
They are configured in the pipeline assigned to the bloque (or directly in the bloque in legacy mode). When a user starts an upload, the system presents these fields before showing the file preview.
campo_carga_ref pointing to the field. This is explained in detail below.
Field properties
Each upload field has the following properties:
- nombre_campo
- Internal field name. Used as identifier throughout the system: in
{{nombre_campo}}references within pipeline SQLs, in fixed columns withcampo_carga_ref, and in group conditions. Must be unique within the pipeline. Use short names without spaces or special characters (e.g.,period,client_id,cutoff_date). - etiqueta
- Label visible to the user in the upload form. Can be long and descriptive (e.g., "Select the reporting period", "Report cutoff date").
- tipo
- Determines the type of control presented to the user. Available types are:
input,number,select,date,file. Each is described in detail below. - opciones
- Only applies to the
selecttype. Defines the dropdown options, either as a CSV list or a SQL query. Detailed in the select type section. - obligatorio
- If enabled, the user cannot proceed with the upload without filling this field. Required fields are shown with a visual indicator (asterisk) in the form.
- orden
- Field position within its group (or within the general list if no groups). Fields are presented to the user in ascending order.
Field types
input — Free text
Single-line text field. The user can type any value. Useful for names, codes, references, short comments.
| Property | Value |
|---|---|
| HTML control | <input type="text"> |
| Validation | Required only (if marked) |
| Options | N/A (ignored) |
| Stored value | Exact text entered by the user |
number — Numeric
Numeric field. Accepts integers and decimals. The browser displays increment/decrement controls and validates that the content is a number.
| Property | Value |
|---|---|
| HTML control | <input type="number" step="any"> |
| Validation | Required + numeric format |
| Options | N/A |
| Stored value | Number as text (e.g., 1234.56) |
step="any" attribute allows decimals with any precision. If the user types "3.14159", that exact value is stored.
select — Dropdown
Selection field with predefined options. Options are defined in the opciones property in two ways:
Static options (CSV list)
A comma-separated list of values. Each value is used as both the visible label and the stored value.
Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
This generates a dropdown with 12 options. If the user selects "Mar", the stored value will be Mar.
Sales,Purchasing,HR,Finance
Dynamic options (SQL query)
If the options field starts with SQL:, the system executes the query against the mmaker_dw database to obtain options in real time.
SQL:SELECT elemento, valor, seleccionado FROM my_options_table WHERE active = 1 ORDER BY elemento
The query must return columns with these exact names:
| Column | Required | Description |
|---|---|---|
elemento | Yes | Text displayed in the dropdown (what the user sees) |
valor | Yes | Internal value stored when the user selects this option |
seleccionado | No | If 1, this option is pre-selected when the form opens. Only one option should have this value. |
SQL:SELECT name AS elemento, id AS valor, 0 AS seleccionado FROM `mmaker_dw`.`dw_1_clients` WHERE active = 1 ORDER BY name
This generates a dropdown with client names but stores the numeric ID.
Dependent selects ({{field}} variables)
SQL queries in a select can reference the value of other upload fields using the {{field_name}} syntax. This enables cascading selects where one field's options depend on what the user selected in a previous field.
SQL:SELECT name AS elemento, id AS valor, 0 AS seleccionado FROM `mmaker_dw`.`dw_1_cities` WHERE country_id = '{{country}}' ORDER BY name
In this example, {{country}} is replaced by the value the user selected in the country field. The select options are reloaded each time the user navigates between wizard groups.
{{field}} are re-evaluated each time the user navigates between wizard groups. If the user changes the value of "country" and returns to the group containing "city", the city options are reloaded with the new country value.
date — Date picker
Date field. The browser displays a native calendar control for date selection.
| Property | Value |
|---|---|
| HTML control | <input type="date"> |
| Validation | Required + valid date format |
| Options | N/A |
| Stored value | ISO date format: YYYY-MM-DD (e.g., 2026-04-07) |
file — Attachment
Field for uploading an attachment file. Unlike the main upload file (which is parsed and loaded into the table), file type attachments are supplementary files stored as-is, without parsing.
| Property | Value |
|---|---|
| HTML control | <input type="file"> |
| Storage | uploads/adjuntos/ with unique internal name |
| Record | Table dw_carga_adjuntos (original name, internal name, size) |
| Options | N/A |
uniqid()), not the user's original filename. The uploads/adjuntos/ directory has an .htaccess that denies direct access. Files can only be downloaded through PHP endpoints with permission verification.
file cannot be used as a fixed column value (campo_carga_ref). They are also excluded from default values in schedules (scheduled executions) and radars, since these processes run without user intervention.
Value storage
The values users enter in upload fields are saved in the dw_carga_campos_valores table, linked to the upload (carga_id). Each row has:
| Column | Description |
|---|---|
carga_id | ID of the upload the values belong to |
nombre_campo | Internal field name (matches the configuration) |
valor | Value entered by the user (always stored as text) |
This means that for each upload, a record of what values the user entered is kept. This can be reviewed later in the upload history.
Linking fields to table columns (campo_carga_ref)
By default, upload fields are only stored as upload metadata (in dw_carga_campos_valores). They do not appear as columns in the bloque's dynamic table.
To make a field's value appear in every row of the dynamic table, you must create a fixed column (fija) with the campo_carga_ref property pointing to the field.
How to do it
- Go to the pipeline (or legacy bloque) structure configuration.
- In the Fixed columns section, add a new fija.
- Give it a
nombre_campo(this will be the column name in the table). - Instead of typing a literal value, activate the toggle to switch to upload field reference mode.
- Select the upload field from the dropdown.
Now, every time an upload is performed, the value the user entered in that field will be inserted into every row of the table as the value for that fixed column.
period (type select with options Jan, Feb, Mar...) and create a fija period with campo_carga_ref = period, every row in the uploaded file will have a column period with the value selected by the user (e.g., "Mar").
Uniqueness by upload field
Fixed columns linked to upload fields can also participate in uniqueness (keys). If you need the key combination to include the upload field, add a key of type campo_carga with the field name. The system will resolve the value by finding the fija that has campo_carga_ref pointing to that field.
Usage in the pipeline (variables)
Upload field values are available as variables in all pipeline steps. They are referenced with the {{field_name}} syntax inside any pipeline SQL.
SELECT * FROM {{_DW_TABLA}}
WHERE _dw_carga_id = {{_DW_CARGA_ID}}
AND period = '{{period}}'
In this example, {{period}} is replaced by the value the user selected in the period field.
Field groups (multi-step wizard)
When a pipeline has many upload fields, or when some fields only apply in certain cases, they can be organized into groups. Groups turn the upload form into a multi-step wizard.
Without groups (legacy mode)
If no groups are defined, all fields are shown at once in a single form step, followed by the file selector. This is the classic behavior.
With groups
If one or more groups are defined, the upload form becomes a wizard:
- The first visible group is shown with its fields.
- The user fills in the fields and clicks Continue.
- The next group's condition is evaluated. If visible, its fields are shown.
- If not visible, it skips to the next group whose condition is met.
- When all groups have been processed, a summary is shown with all entered values plus the file selector.
- The user confirms and proceeds to the preview.
Continue and Back buttons allow navigation between groups.
Group properties
- nombre
- Visible title of the group in the wizard. Displayed as the heading for the current step.
- orden
- Group position in the wizard sequence. Groups are presented in ascending order.
- condicion_tipo
- Determines when the group is shown. Options are:
siempre— Group is always shown, no condition.valor_igual— Group only shown when another field's value equals a specific value.valor_diferente— Group only shown when another field's value differs from a specific value.sql— Group shown if a SQL query returns at least one row (server-side evaluation).
- condicion_campo
- Only applies to
valor_igualandvalor_diferente. Name of the upload field whose value is evaluated. Must be a field from a previous group (already filled by the user). - condicion_valor
- Only applies to
valor_igualandvalor_diferente. Value to compare against. Forsql, contains the SQL query to execute.
Conditional groups example
Suppose a process where the user first selects the operation type, then different fields are shown depending on the selection:
| Group | Order | Condition | Fields |
|---|---|---|---|
| General data | 1 | siempre |
operation_type (select: Sale, Purchase, Return), date |
| Sale data | 2 | valor_igual, field: operation_type, value: Sale |
client, salesperson, discount |
| Purchase data | 3 | valor_igual, field: operation_type, value: Purchase |
supplier, purchase_order |
| Return data | 4 | valor_igual, field: operation_type, value: Return |
reason, original_reference |
If the user selects "Sale", they will see: General data → Sale data → Summary. The purchase and return groups are automatically skipped.
Fields without a group
Fields that do not belong to any group are shown in an implicit initial step, before any defined groups. If all fields have a group assigned, there is no implicit step.
SQL condition in groups
The sql condition allows more complex logic. The query is executed on the server (mmaker_dw) and can reference already-filled fields with {{field_name}}:
SELECT 1 FROM `mmaker_dw`.`dw_1_configuration` WHERE type = '{{operation_type}}' AND requires_approval = 1
If the query returns at least one row, the group is shown. If it returns no rows, the group is skipped.
Pipeline without file
When a pipeline is configured without a file ("No file" toggle in the wizard), upload fields become the only data source. In this mode:
- No Excel/CSV file is uploaded.
- Each upload inserts a single row into the dynamic table.
- The row values come from fixed columns linked to upload fields (
campo_carga_ref). - The wizard auto-generates a fija for each upload field (except type
file).
This mode is useful for manual entry processes: creating a new record, logging an incident, capturing an event, etc.
UI configuration
Where to configure
Upload fields are configured in step 2 of the wizard when creating/editing a pipeline (or legacy bloque). Step 2 is dedicated exclusively to upload fields.
Available actions
- Add field: Button to create a new field with the properties described above.
- Reorder: Drag fields to change their presentation order.
- Edit: Modify any property of an existing field.
- Delete: Remove a field from the pipeline. Values already saved in previous uploads are preserved in
dw_carga_campos_valores. - Create group: Organize fields into groups for the multi-step wizard.
Fields in scheduled executions and radars
Schedules and radars can preconfigure default values for upload fields. These values are used automatically when the execution triggers without user intervention. Fields of type file are excluded from default values, as attachment files cannot be preconfigured.
Pipeline Steps (Post-load)
Pipeline steps are actions executed automatically after data is inserted into a bloque's dynamic table. They form a decision tree that can validate data, execute SQL, capture variables, send emails, generate files, change states, and more.
Steps are configured in the pipeline assigned to the bloque. They execute in order (by their orden field), unless transitions redirect the flow to a different step.
validacion_stop step detects a problem, everything is rolled back: the inserted data and any SQL changes from the pipeline are undone.
General concepts
Execution order
By default, steps execute sequentially according to their orden field. However, if a step has transitions defined, the flow jumps to the step indicated by the first matching transition. If no transition matches and a resto (fallback) transition exists, that one is used.
If no transitions are defined for a step, execution simply continues to the next step by order.
Anti-loop protection
A step never executes twice in the same pipeline run. If a transition points to an already-executed step, it is skipped and execution continues to the next step.
Execution condition (sql_condicion)
Any step can have an sql_condicion field. If defined, the system executes that SQL query before the step:
- If the query returns at least one row → the step executes.
- If the query returns no rows → the step is skipped (moves to the next one).
This allows conditional step execution without needing transitions. The sql_condicion can use the same {{...}} variables as the rest of the step.
SELECT 1 FROM {{_DW_TABLA}} WHERE _dw_carga_id = {{_DW_CARGA_ID}} AND amount > 10000
In this example, the step only executes if there is any row with an amount greater than 10,000.
Available variables
All pipeline steps can use variables within their SQL fields. They are referenced with the {{NAME}} syntax and are substituted before executing the SQL.
| Variable | Description |
|---|---|
{{_DW_CARGA_ID}} | ID of the current upload |
{{_DW_TABLA}} | Full name of the dynamic table (e.g., `mmaker_dw`.`dw_1_sales`) |
{{_DW_BLOQUE_ID}} | Bloque ID |
{{_DW_FICHERO}} | Name of the uploaded file |
{{_DW_PARENT_CARGA_ID}} | ID of the parent upload (only in BPM actions linked to another upload) |
{{_DW_ESTADO_BPM}} | Current BPM state of the upload (updated after estado type steps) |
{{ESTADO}} | Internal pipeline state: starts as ok, becomes error if something fails |
{{field_name}} | Value of the upload field with that name (filled by the user) |
{{step_variable}} | Variable captured by a previous variable type step |
variable step in fixed mode can have variable_valor = "Report for {{period}} - {{client}} ({{total_rows}} rows)", combining upload field values.
The {{ESTADO}} variable
The {{ESTADO}} variable is an internal indicator that reflects whether the pipeline has had problems:
- Starts with value
ok. - Changes to
errorif avalidacion_stopstep fires (finds problematic rows). - Changes to
errorif a SQL execution fails. - Shared between the parent pipeline and nested triggers.
You can use {{ESTADO}} in transitions to branch the flow based on whether there were errors.
User message (mensaje_usuario)
Validation steps (validacion_stop and validacion_alarma) can have a mensaje_usuario template. This template generates human-readable messages from the SQL result rows.
The template uses {{column}} to substitute values from each SQL result row:
Row {{line}} has product "{{product}}" with negative amount ({{amount}})
If mensaje_usuario is not defined, the system looks for a MSG column in the SQL result. If that doesn't exist either, a JSON dump of the row is shown.
Step types
validacion_stop — Validation with rollback
The most critical pipeline step. Executes a SQL query and, if it returns rows, the validation is considered failed. All upload data is deleted (complete rollback: DELETE of inserted rows + reversal of any SQL executed previously in the pipeline).
- sql_code
- SQL query that searches for problematic rows. If it returns at least one row, validation fails. If it returns no rows, validation passes and the pipeline continues.
SELECT _dw_linea AS line, product, amount FROM {{_DW_TABLA}} WHERE _dw_carga_id = {{_DW_CARGA_ID}} AND amount < 0 - mensaje_usuario
- Template to generate readable messages for each problematic row. Uses
{{column}}to insert SQL result values.Line {{line}}: product "{{product}}" has negative amount ({{amount}})
Error message hierarchy:
- If
mensaje_usuariois defined → the template is applied to each row. - If not, and the SQL has a
MSGcolumn → that column's value is used. - If neither → a JSON dump of each row is shown.
INSERT, UPDATE, or DELETE executed by previous steps in the same pipeline is also undone. This is possible because the entire pipeline runs within a transaction.
Effect on {{ESTADO}}: If validation fails, {{ESTADO}} changes to error.
validacion_alarma — Validation without rollback
Works the same as validacion_stop regarding SQL and messages, but with a fundamental difference: it does NOT rollback. Data is kept and the upload completes. Problematic rows are shown as warnings to the user.
- sql_code
- Same logic as
validacion_stop. Query that searches for suspicious rows. - mensaje_usuario
- Same template as
validacion_stopfor readable messages.
Warnings are shown in the preview modal after confirming the upload, alongside the results table (if any). The user sees the data but is informed about the issues.
sql — SQL execution
Executes a SQL query directly against the mmaker_dw database. Can be any DML operation: INSERT, UPDATE, DELETE, or even CREATE INDEX.
- sql_code
- SQL query to execute. The number of affected rows is logged.
UPDATE {{_DW_TABLA}} SET amount_eur = amount * exchange_rate WHERE _dw_carga_id = {{_DW_CARGA_ID}}
The step result (affected rows) is recorded in the log. If the SQL fails, {{ESTADO}} changes to error and the error is logged, but the pipeline continues with subsequent steps (no automatic rollback — that's what validacion_stop is for).
- Calculate derived columns (conversions, percentages, classifications).
- Update summary or aggregate tables.
- Insert records into other tables (logs, audits, notifications).
- Delete old or temporary data.
variable — Variable capture
Captures a value and makes it available as a variable for subsequent pipeline steps. Has two operating modes:
SQL mode
Executes a SQL query and converts the first row's columns into variables. Each column becomes a variable with the column's name.
- sql_code
- Query that returns the values to capture.
SELECT COUNT(*) AS total_rows, SUM(amount) AS total_amount, MAX(date) AS most_recent_date FROM {{_DW_TABLA}} WHERE _dw_carga_id = {{_DW_CARGA_ID}}
After this step, the variables {{total_rows}}, {{total_amount}}, and {{most_recent_date}} are available in all subsequent steps.
Fixed mode
Assigns a literal value directly, without executing SQL.
- variable_nombre
- Name of the variable to create (e.g.,
report_title). - variable_valor
- Literal value to assign. Can reference other variables with
{{...}}.Report for {{period}} - {{client}} ({{total_rows}} rows)
After this step, {{report_title}} contains the text with all variables substituted.
Variable persistence
All captured variables (both SQL and fixed mode) are saved in the dw_pipeline_variables table linked to the upload. This allows:
- Viewing captured values in the upload history.
- Displaying information on Kanban cards (via bricks).
- Auditing what values were used in each pipeline execution.
mailing — Email sending
Sends emails with dynamically generated attachments from a SQL query. Requires the company to have SMTP configured in dw_mail_config.
- sql_contenido
- Important: Mailing uses the
sql_contenidofield, NOTsql_code. This query generates the data used for both the email body and attachment files.SELECT c.email AS DESTINO, c.name AS client_name, s.date, s.product, s.amount, CONCAT(c.name, '_', DATE_FORMAT(s.date, '%Y%m')) AS ADJUNTO FROM {{_DW_TABLA}} s JOIN `mmaker_dw`.`dw_1_clients` c ON c.id = s.client_id WHERE s._dw_carga_id = {{_DW_CARGA_ID}}
Special columns in the SQL
| Column | Required | Description |
|---|---|---|
DESTINO | Yes | Recipient email address(es). Can be a single email or multiple separated by comma (ana@company.com,pedro@company.com). |
ADJUNTO | No | Grouping key. All rows with the same ADJUNTO value are grouped into a single attachment file. Each distinct value generates a separate file. If this column doesn't exist, all rows go into one attachment. |
FORMATO | No | csv or excel. Determines the attachment file format. Defaults to excel if not present. |
ELEMENT | No | Additional variable available for substitution in the email subject and body. Useful for personalizing the message with row data. |
- mail_titulo
- Email subject. Supports variables:
{{ADJUNTO}},{{ELEMENT}}, and any pipeline variable.Sales report - {{ADJUNTO}} - {{period}} - mail_cuerpo
- HTML email body. Same substitutions as the subject.
<h2>Sales Report</h2> <p>Attached is the sales report for {{ADJUNTO}}.</p> <p>Period: {{period}}</p> <p>Total rows processed: {{total_rows}}</p>
How the sending process works
sql_contenidois executed to obtain the data.- Rows are grouped by the
ADJUNTOvalue (if the column exists). - For each group, an attachment file is generated (Excel XML 2003 or CSV per
FORMATO) with the data columns (excluding the special columns DESTINO, ADJUNTO, FORMATO, ELEMENT). - Unique email addresses are collected from the
DESTINOcolumn for that group. - The email is sent with the attachment to all recipients in the group.
- The send is logged in
dw_mail_log.
ADJUNTO value (e.g., "Ana_202604", "Pedro_202604", "Luis_202604"), 3 emails will be sent: each with an Excel file containing only that client's sales rows.
trigger — Call another pipeline
Executes another complete pipeline within the current one. It's like a "function call": the referenced pipeline runs inline, sharing the context (variables, upload, transaction).
- trigger_pipeline_id
- ID of the pipeline to execute. Selected from a list of available pipelines in the company.
Detailed behavior
| Aspect | Behavior |
|---|---|
| Variables | Shared bidirectionally. Parent variables are available in the trigger, and variables created in the trigger are available in the parent after returning. |
| validacion_stop | If a validacion_stop fires inside the trigger, it aborts everything: the trigger and the parent pipeline. Complete rollback. |
| FIN transition | A transition pointing to NULL (end of pipeline) inside the trigger only ends the trigger. The parent pipeline continues with its next step. |
| {{ESTADO}} | Shared. If the trigger fails, the parent sees {{ESTADO}} = 'error'. |
| Depth | Maximum 5 nesting levels (trigger within trigger within trigger...). If exceeded, the step fails with an error. |
| Log | Log messages from the trigger are prefixed with the trigger pipeline name to distinguish them from the parent. |
bucle — Loop (iteration)
Executes a set of embedded SQLs for each row of a main query's result. Useful for operations that require row-by-row processing.
- sql_code
- Main loop query. Each result row is one iteration.
SELECT DISTINCT client_id, client_name FROM {{_DW_TABLA}} WHERE _dw_carga_id = {{_DW_CARGA_ID}} - bucle_pasos
- JSON array of embedded SQLs executed per row. Each element has
nombre(descriptive name) andsql(the query to execute).[ { "nombre": "Update totals", "sql": "UPDATE `mmaker_dw`.`dw_1_client_summary` SET total = (SELECT SUM(amount) FROM {{_DW_TABLA}} WHERE client_id = '{{client_id}}') WHERE id = '{{client_id}}'" }, { "nombre": "Log activity", "sql": "INSERT INTO `mmaker_dw`.`dw_1_activity_log` (client_id, action, date) VALUES ('{{client_id}}', 'upload_updated', NOW())" } ]
Detailed behavior
- Columns from each result row of
sql_codebecome temporary variables (e.g.,{{client_id}},{{client_name}}). - General pipeline variables remain available within the loop.
- After each iteration, temporary variables are restored to their original values (they don't contaminate the next iteration or the parent pipeline).
- If an embedded SQL fails,
{{ESTADO}}changes toerrorand is logged, but the loop continues with subsequent iterations. - The log shows:
Bucle[0].Update totals: 1 row(s) affected.
UPDATE ... JOIN or INSERT ... SELECT instead of a loop. Reserve loops for operations that truly require row-by-row processing.
tabla — Results table
Generates a data table displayed to the user in the interface. Does not modify data — only serves to display information.
- sql_code
- Query that generates the data to display.
SELECT product, SUM(amount) AS total_amount, COUNT(*) AS num_rows FROM {{_DW_TABLA}} WHERE _dw_carga_id = {{_DW_CARGA_ID}} GROUP BY product ORDER BY total_amount DESC
The result is saved in the upload log (dw_carga_log) with tipo = 'tabla' and displayed in two places:
- Post-upload: In the preview modal after confirming, alongside alarm warnings (if any).
- Upload detail: In the history view, "Results tables" section above the execution log.
If there are multiple tabla steps in the pipeline, the tables are shown stacked (one below the other), each with its title (the step name).
flyout — File generation
Generates an Excel or CSV file from a SQL query. The file can be downloaded from the interface or sent directly to an FTP/SFTP server.
- sql_code
- Query that generates the file data.
SELECT product, date, amount, client_name FROM {{_DW_TABLA}} t JOIN `mmaker_dw`.`dw_1_clients` c ON c.id = t.client_id WHERE t._dw_carga_id = {{_DW_CARGA_ID}} ORDER BY date, product - flyout_formato
excel(Excel XML 2003 format, .xls extension) orcsv(plain text, semicolon-separated).- flyout_nombre
- Generated filename. Supports
{{...}}variables for dynamic names.Sales_{{period}}_{{client}}.xls - flyout_destino
-
descarga— File is saved inuploads/flyouts/and available for download from the upload detail in the UI.ftp— File is automatically sent to a configured FTP/SFTP server.
- flyout_ftp_id
- Only if
flyout_destino = ftp. Reference to the FTP/SFTP configuration indw_ftp_config(selected from a dropdown in the UI).
The generated file record is saved in dw_flyout_log with information about name, format, destination, status, and row count.
uploads/flyouts/ are not directly accessible via URL. They can only be downloaded through the get_flyout endpoint, which verifies resource ownership before serving the file.
estado — BPM state change
Changes the BPM state (estado_bpm) of an upload. Used in pipelines linked to Kanban actions and state transitions.
- estado_valor
- State value to assign. Can be a literal text or use
{{...}}variables for dynamic value.ApprovedOr with a variable:
{{new_state}}
Behavior by context
| Situation | Behavior |
|---|---|
Upload has parent_carga_id | Sets estado_bpm on the parent upload, not the current one. |
Upload does NOT have parent_carga_id | Sets estado_bpm on the current upload. |
After assignment, the {{_DW_ESTADO_BPM}} variable is updated immediately, so subsequent pipeline steps already see the new state.
estado step with estado_valor = Approved. This updates the upload and moves the card on the board.
Transitions between steps
Transitions control the pipeline's execution flow, creating a decision tree instead of a linear sequence. Each step can have multiple transitions with different conditions.
Transition types
| Type | Condition | Description |
|---|---|---|
siempre | None | Always triggers, no condition. Equivalent to an unconditional jump. |
hay_filas | SQL result | Triggers if the current step returned rows in its result (applies to validations, SQL variables, etc.). |
sin_filas | SQL result | Triggers if the current step returned NO rows. |
valor_igual | Variable | Triggers if the specified variable (variable_name) has a value equal to valor_esperado. |
valor_diferente | Variable | Triggers if the variable has a value different from valor_esperado. |
valor_mayor | Variable | Triggers if the variable is numerically greater than valor_esperado. |
valor_menor | Variable | Triggers if the variable is numerically less than valor_esperado. |
valor_mayor_igual | Variable | Triggers if the variable is greater than or equal to valor_esperado. |
valor_menor_igual | Variable | Triggers if the variable is less than or equal to valor_esperado. |
resto | Fallback | Triggers only if no other transition from the same step matched. Acts as an "else" or "default". |
Transition properties
- paso_origen_id
- The step from which the transition originates (set automatically when creating the transition from a step).
- paso_destino_id
- The step to jump to if the condition is met. If
NULL, indicates end of pipeline — execution stops here. - tipo
- Condition type (see table above).
- variable_name
- Only for
valor_*types. Name of the variable whose value is evaluated (e.g.,total_rows,ESTADO). - valor_esperado
- Only for
valor_*types. Value to compare the variable against. - orden
- Evaluation order. Transitions are evaluated in ascending order and the first match is used.
Evaluation rules
- After executing a step, its transitions are looked up ordered by
orden. - Each condition is evaluated in sequence.
- The first transition whose condition is met determines the next step.
- If no condition is met and a
restotransition exists, that one is used. - If no transitions are defined (or none match and there's no
resto), execution continues to the next step byorden.
Decision tree example
Step 1: variable (SQL) → captures {{total_rows}}
├── valor_mayor total_rows > 1000 → Step 4 (high volume alert)
├── valor_igual total_rows = 0 → NULL (end: no data)
└── resto → Step 2 (normal flow)
Step 2: validacion_stop → check duplicates
├── hay_filas → NULL (end: automatic rollback)
└── sin_filas → Step 3
Step 3: sql → calculate totals
└── siempre → Step 5
Step 4: validacion_alarma → warn high volume
└── siempre → Step 2
Step 5: mailing → send summary
(no transitions → end of pipeline)
UI configuration
Step editor
Steps are managed from the Structure tab of the pipeline (or legacy bloque). Each step is shown as a card with its type, name, and an active/inactive indicator.
Creating a step
Use the "Add step" button below the step list. A form opens with the fields corresponding to the selected step type. The visible fields change based on the chosen type.
Deactivating a step
A step can be deactivated without deleting it (activo field). An inactive step is skipped during execution but preserved in the configuration so it can be reactivated later.
Transition editor
Each step has a button to manage its transitions. Clicking it shows the transition editor where you can add, modify, and delete transitions. It shows the destination step (or "END" to terminate the pipeline), the condition type, and comparison values.
Reordering steps
The orden field determines the base sequence. Steps can be reordered by dragging. The order matters when there are no transitions: the system follows the next step by numeric order.
BPM / Kanban
The {M}aker BPM (Business Process Management) system allows you to manage workflows over data loads (cargas) using a visual Kanban board. Each DW bloque can have its own board with configurable states, controlled transitions, and invocable actions on existing loads.
Overview
The BPM system consists of four main elements:
- States
- Stages that a load goes through (e.g., "Pending", "Under review", "Approved", "Rejected"). Configured per bloque.
- Kanban board
- Visual view with columns = states and cards = loads. Cards are draggable between columns.
- Transitions
- Rules that define which movements are allowed between states, and which pipeline (if any) executes on the move.
- Actions
- Pipelines that can be manually invoked on existing loads. They allow executing logic (mailing, triggers, state changes) without creating new data.
Kanban states
States define the stages of the process. They are configured in the Kanban tab of the bloque, using the "Configurar" (Configure) button.
State properties
| Property | Description |
|---|---|
| Name | Free text identifying the state. Appears as the column title on the board. Example: "Pending", "In progress", "Completed". |
| Color | Hex color for the board column (e.g., #3b82f6 for blue). Each state has its own color for quick visual differentiation. |
| Is initial | If checked, newly confirmed loads in this bloque automatically receive this state. Only one state should be initial. If no initial state exists, new loads don't enter the Kanban. |
| Is final | Marks the state as a terminal state. Informational: does not block movements but visually indicates that the load has completed its lifecycle. |
| Order | Column position on the board, from left to right. States are sorted from lowest to highest order. |
es_inicial = 1, the system automatically assigns that state to the new load (via setInitialEstadoBpm). This guarantees every new load enters the board in the correct column without manual intervention.
Renaming states
When renaming an existing state, the system automatically reassigns all loads that had the old name to the new name. This is managed via the renombramientos array sent on save: each entry indicates {de: "old_name", a: "new_name"}.
estado_bpm that doesn't match any configured state. They won't appear on the Kanban board. Use reassignments to move loads to another state before deleting.
Reassignments
When saving state configuration, you can include reassignments to move loads from one state to another. Each reassignment indicates {de: "source_state", a: "target_state"}. This is useful when deleting a state and wanting to redistribute its loads.
Kanban board
The board is displayed in the Kanban tab of the bloque. It presents a column view where:
- Each column represents a configured state, with its color and name as header.
- Each card represents a load with that
estado_bpm. - Cards are draggable (drag & drop) between columns.
- Each column header shows the count of cards it contains.
Card configuration (Bricks)
Kanban cards display configurable information via bricks. Bricks are configured in the "Configurar" button of the Kanban, under the "Tarjetas" (Cards) tab.
Each brick references a variable captured during pipeline execution (stored in dw_pipeline_variables) or a campo_carga value. Bricks have three possible roles:
| Role | Description | Quantity |
|---|---|---|
| Header (cabecera) | Main title of the card. Displayed in bold at the top. Typically the file name, an identifier, or a significant field. | One variable |
| Detail (detalle) | Card subtitle. Displayed below the header in smaller text. Could be a date, a responsible user, etc. | One or more variables |
| Brick | Informational chips in the card body. Each shows a label and the variable's value, with configurable color. Ideal for showing metrics, amounts, categories. | Multiple |
total_rows, total_amount, or client, they appear available for brick configuration. Campo_carga values are also available.
Card configuration example
Header: client --> "Acme Corp"
Detail: order_date --> "2026-03-15"
Brick: total_amount --> [Amount: 12,500.00]
Brick: line_count --> [Lines: 48]
Brick: priority --> [Priority: High]
Transitions
Transitions define which movements are allowed between states on the Kanban board. They are configured in the "Configurar" button of the Kanban, under the "Transiciones" (Transitions) tab.
Transition properties
| Property | Description |
|---|---|
| Source state | State from which the card is allowed to move. |
| Target state | State to which the card is allowed to move. |
| Pipeline (optional) | Pipeline that executes automatically when the transition occurs. If not configured, the state change is direct. |
Transitions with pipeline
When a transition has an associated pipeline:
- The user drags the card to the target column.
- The system verifies the transition exists.
- The associated pipeline executes (which typically includes a
estadostep to change theestado_bpm). - If the pipeline fails or a
validacion_stoptriggers, the card does not move and stays in its original column. - If the pipeline completes successfully, the card reflects the new state.
estado step that assigns the target state. It can also include validations (verify conditions before allowing the change), mailings (notify the responsible person), triggers (execute additional logic), or any combination of steps.
Actions on loads
Actions allow executing pipelines on existing loads without uploading a new file. They are configured in the Acciones (Actions) tab of the bloque.
Action properties
| Property | Description |
|---|---|
| Name | Descriptive text for the action (e.g., "Approve order", "Send notification", "Reject with reason"). |
| Icon | Emoji or character that visually identifies the action in buttons (e.g., ▶). |
| Pipeline | Pipeline executed when the action is invoked. Typically a pipeline without a table (only executes steps). |
| Source state | If configured, the action is only visible when the load is in this state. If NULL, the action is available in any state. |
Executing actions
Actions appear as buttons in the load detail (in the Cargas tab of the bloque) and in the portal history. When clicked:
- A modal opens with the campos_carga (upload fields) of the action's pipeline (if any). This allows the user to enter additional data (e.g., rejection reason, comment, date).
- Upon confirmation, the pipeline executes on the existing load (
executePipelineAction). - The pipeline has access to the original load's variables:
{{_DW_CARGA_ID}},{{_DW_TABLA}},{{_DW_BLOQUE_ID}}. - The variable
{{_DW_PARENT_CARGA_ID}}is available to reference the parent load. - Results (logs, tables, errors) are shown after execution.
estado_origen = "Pending", it will only appear for loads whose estado_bpm is "Pending". When the load moves to another state, the button disappears. Use estado_origen = NULL for actions that should always be available.
Pipelines without table
Pipelines with an empty nombre_tabla (nullable) are pipelines that only execute steps without inserting data into a dynamic table. They are ideal for BPM actions:
- State change: an
estadostep that updates theestado_bpm. - Notifications: a
mailingstep that sends an email. - Chained logic: a
triggerstep that invokes another pipeline. - Validations: a
validacion_stopstep that verifies conditions before allowing a transition.
To create a pipeline without a table, enable the "Sin fichero" (No file) toggle in step 1 of the pipeline wizard. The pipeline will not create a target table in the DW database.
The "estado" step type
The estado step type is a pipeline step designed specifically for BPM. It allows changing the estado_bpm of a load.
Properties
- estado_valor
- Value of the state to assign. Can be a fixed text (e.g.,
Approved) or an expression with variables (e.g.,{{new_state}}) for dynamic values based on prior pipeline logic.
Behavior
- If the load has
parent_carga_id(it's the result of an action), the state is assigned to the parent load. - If the load has no parent, the state is assigned to the load itself.
- After assignment, the variable
{{_DW_ESTADO_BPM}}is updated immediately and is available for subsequent pipeline steps.
validacion_stop that verifies the amount doesn't exceed a limit, 2) estado step with estado_valor = "Approved", 3) mailing step that notifies the requester. If validation fails, the state doesn't change and the email is not sent.
Parent-child relationship between loads
When an action is executed on a load, a child load is created linked via parent_carga_id. This allows:
- Tracking which actions have been executed on an original load.
- The
estadostep type to write the new state to the parent load (the original), not the child load (the action). - Viewing the complete history of actions executed on a load via the
carga_hijasendpoint.
Step-by-step configuration
1. Create states
- Select the bloque in the sidebar.
- Go to the Kanban tab.
- Click "Configurar" (Configure).
- In the "Estados" (States) tab, add states with name, color, and order.
- Mark one as initial so new loads automatically enter the Kanban.
- Save the configuration.
2. Configure cards
- In the same configuration window, go to the "Tarjetas" (Cards) tab.
- Select a variable as header (card title).
- Optionally, select variables as detail (subtitle).
- Add bricks with the variables you want to show as chips, with label and color.
- Save the configuration.
3. Define transitions
- In the "Transiciones" (Transitions) tab, define each allowed movement.
- For each transition, indicate source state, target state, and (optionally) pipeline to execute.
- Save the configuration.
4. Create actions (optional)
- Go to the Acciones (Actions) tab of the bloque.
- Click "Nueva accion" (New action).
- Configure name, icon, pipeline (typically without table), and source state (if you want to filter by state).
- Save the action.
estado steps if you want them to change the estado_bpm automatically.
Scheduled execution
{M}aker allows automating pipeline execution through two mechanisms: schedules (cron-based programmed executions) and radars (FTP/SFTP folder watchers). Both are configured per bloque and run automatically via the scheduler.php script.
scheduler.php script must be configured as a system cron job running every minute: * * * * * php /path/to/mmaker/scheduler.php
Schedules (programmed execution)
A schedule executes a pipeline automatically at a frequency defined by a cron expression, without needing to upload a file. Ideal for recurring processes that don't depend on new file data (consolidations, periodic calculations, report dispatching).
Configuration
Schedules are managed in the "Programados" (Scheduled) tab of the bloque. Each schedule has the following properties:
| Property | Description |
|---|---|
| Name | Unique identifier for the schedule within the company. Appears in logs and UI cards. |
| Description | Optional free text to document the schedule's purpose. |
| Cron expression | Standard 5-field cron expression: minute hour day_of_month month day_of_week. Defines execution frequency. See the "Cron expressions" section below. |
| Field values | Default values for the pipeline's campos_carga (upload fields), excluding type file. These values are used automatically on each execution without user intervention. |
| Active | Toggle on/off. If deactivated, the schedule won't execute even when its time arrives. |
Cron expressions
The cron expression uses the standard 5-field format:
* * * * *
| | | | |
| | | | +-- day of week (0-7, 0 and 7 = Sunday)
| | | +------- month (1-12)
| | +------------ day of month (1-31)
| +----------------- hour (0-23)
+---------------------- minute (0-59)
The interface offers presets for the most common expressions:
| Preset | Expression | Meaning |
|---|---|---|
| Every hour | 0 * * * * | At minute 0 of every hour |
| Daily 8am | 0 8 * * * | Every day at 8:00 |
| Monday 8am | 0 8 * * 1 | Every Monday at 8:00 |
| Mon-Fri 8am | 0 8 * * 1-5 | Monday to Friday at 8:00 |
| 1st of month | 0 8 1 * * | First day of each month at 8:00 |
| Every 5 min | */5 * * * * | Every 5 minutes |
Internal operation
- The
scheduler.phpscript runs every minute. - It selects all active schedules whose
proxima_ejecucionis less than or equal to the current time. - For each schedule, it executes
executeNoFilePipeline(), which creates a load withnombre_fichero = '[programado] schedule_name'and runs the pipeline associated with the bloque. - After execution, it automatically recalculates
proxima_ejecucionusing the cron parser. - It logs the result in
dw_scheduler_logwith status, duration, and generated load.
UI cards
Each schedule is displayed as a card with:
- Name of the schedule.
- Human-readable cron: the cron expression translated to text (e.g., "Monday to Friday at 8:00").
- Status badge:
ok(green),error(red), orprocesando(yellow) from the last execution. - Next execution: calculated date and time of the next run.
- Buttons: Execute (manual run), Edit, Activate/Deactivate, Delete.
Radars (folder watchers)
A radar watches an FTP or SFTP folder to detect new files and process them automatically. Ideal for integrations with systems that deposit files on a server (ERP, banks, suppliers).
Configuration
Radars are managed in the "Radares" (Radars) tab of the bloque. Each radar has the following properties:
| Property | Description |
|---|---|
| Name | Unique identifier for the radar within the company. |
| Description | Optional free text. |
| Source type | ftp -- references an existing FTP/SFTP configuration (see "FTP/SFTP configuration" section). |
| FTP configuration | Selector of the previously configured FTP/SFTP destination (only visible when type = ftp). |
| Remote path | Directory within the FTP/SFTP server to scan for files. Default: /. |
| File pattern | Glob pattern to filter files. Examples: *.xlsx (all Excel files), sales_*.csv (CSVs starting with "sales_"), * (all). Default: *. |
| Interval (min) | Polling frequency in minutes. Minimum 1 minute. The radar only scans if at least this many minutes have passed since the last check. |
| Field values | Default values for campos_carga, same as in schedules. |
| Move processed | If enabled, after successfully processing a file it's moved to a procesados/ subfolder (or the path specified in ruta_procesados) on the FTP/SFTP server. If not, the file stays in place (and could be reprocessed in the next cycle). |
| Processed path | Custom path where processed files are moved. If not specified, procesados/ relative to the radar's path is used. |
| Active | Toggle on/off. |
Internal operation
- The
scheduler.phpscript checks active radars whoseultima_revision+intervalo_minhas expired. - It scans the remote folder with
scanFtpFiles(), filtering bypatron_fichero. - For each file found:
- Downloads the file temporarily (
downloadFtpFile()). - Executes the complete load flow: parsing, singularity delete, insert, pipeline.
- If
mover_procesadosis enabled and the load was successful, moves the file to the subfolder.
- Downloads the file temporarily (
- Logs each processed file in
dw_scheduler_log.
UI cards
Each radar is displayed as a card with:
- FTP badge indicating the connection type.
- Pattern: configured file pattern.
- Interval: polling frequency.
- Status badge:
ok,error, orsin_ficheros(no files) from the last check. - Buttons: Test (scan without processing), Edit, Activate/Deactivate, Delete.
FTP/SFTP configuration
FTP/SFTP destinations are configured at the company level and can be used by both radars and flyout pipeline steps. They are managed from the pipeline panel, FTP/SFTP section.
FTP configuration properties
| Property | Description |
|---|---|
| Name | Unique identifier within the company. Appears in radar and flyout selectors. |
| Protocol | ftp (standard FTP) or sftp (SSH File Transfer Protocol, more secure). |
| Host | Server address (IP or domain). Example: ftp.company.com. |
| Port | Connection port. Default: 21 for FTP, 22 for SFTP. |
| Username | Username for authentication. |
| Password | Password. Only updated when a new value is sent (current value is not shown for security). |
| Destination path | Base directory on the server. Default: /. |
| Passive mode | FTP only: enables passive mode (PASV). Recommended when firewalls are involved. Enabled by default. |
ssh2 PHP extension to be enabled. If not available, the system will show a clear error indicating the extension is needed. Standard FTP does not require additional extensions.
SMTP configuration (mailing)
For mailing pipeline steps to send emails, the company's SMTP server must be configured. This is done in the administration panel, "Mail" section.
SMTP configuration properties
| Property | Description |
|---|---|
| SMTP Host | SMTP server. Example: smtp.gmail.com, smtp.office365.com. |
| SMTP Port | Server port. Typical values: 587 (TLS), 465 (SSL), 25 (no encryption). |
| SMTP Username | Email or username for SMTP authentication. |
| SMTP Password | SMTP account password. Only updated when a new value is sent. |
| Sender email | "From" address on sent emails. |
| Sender name | Name displayed alongside the sender email (optional). |
| Encryption | tls (recommended), ssl, or none (no encryption, not recommended). |
Scheduler log
All executions (schedules and radars) are logged in dw_scheduler_log with:
- Type:
scheduleorradar. - File: name of the processed file (radars only).
- Status:
ok,error, orsin_ficheros(no files). - Message: result or error detail.
- Duration: execution time in seconds.
- Load: reference to the generated load (if any).
The log is accessible from the UI in the detail of each schedule or radar, showing the last 20 executions.
User portal
The portal is a simplified interface designed for end users (usuario role). It allows uploading files, checking load status, and reviewing history, without access to {M}aker's technical configuration.
usuario role are automatically redirected to the portal when they access {M}aker's main URL (index.php). They do not have access to the configuration interface (queries, reports, packs, pipelines).
Access and permissions
Portal users only see the resources (apps and bloques) for which they have explicit permission. The administrator configures these permissions from {M}aker's main interface.
Access axes
There are two ways to grant access to a user:
- App permission
- The user receives access to an entire app (
tipo_recurso = dw_app). This gives them access to all bloques within that app. If new bloques are added to the app, the user sees them automatically. Ideal for users who need broad access to a functional area. - Bloque permission
- The user receives access to a specific bloque (
tipo_recurso = dw_bloque). They can only view and upload data to that particular bloque. Ideal for users with responsibility over a specific data type.
Configuring permissions (from the main interface)
Permissions are managed from {M}aker's Administration section (accessible only to admin and superadmin roles):
- Go to the user administration section.
- Select the user you want to grant access to.
- In the permissions section, add resources:
- dw_app: access to an app and all its bloques.
- dw_bloque: access to a specific bloque.
- report: access to a report (for other contexts outside the portal).
- pack: access to a pack (for other contexts outside the portal).
- Save the permissions.
The admin_guardar_permisos endpoint replaces all user permissions at once (it's not incremental: send the complete desired list).
Portal interface
The portal has a clean, modern interface with the following sections:
Search bar
At the top, a search bar allows filtering visible apps and bloques by name. Filters in real time as the user types.
Apps and bloques view
The main screen shows accessible apps, each as an expandable card containing its bloques. Each bloque has an "Subir" (Upload) button that starts the upload flow.
If the user has direct access to bloques that don't belong to any app (or whose app is not in their permissions), these are shown in a separate section.
Recent activity
Feed of the user's most recent loads across all accessible bloques. Shows:
- Uploaded file name.
- Target bloque.
- Load status (
ok,error,procesando). - Date and time.
- Number of processed rows.
Per-bloque history
Detailed view of all loads for a bloque, accessible from each bloque's history button. Shows:
- List of loads with status, file, date, ok/error rows.
- Detail of each load: execution log, per-row errors, result tables.
- "Acciones" (Actions) button (if the bloque has BPM actions configured) -- see next section.
Upload flow
The upload flow in the portal is identical to {M}aker's main interface, including the field groups system.
Flow with field groups
If the bloque's pipeline has campo_carga groups configured, the upload modal is presented as a multi-step wizard:
- Group 1: The first visible group's fields are shown. The user fills in the values and clicks "Continuar" (Continue).
- Condition evaluation: When advancing, the system evaluates the next group's condition:
siempre(always): the group is always shown.valor_igual/valor_diferente: the group is shown only if a previous field has (or doesn't have) a specific value.sql: the server evaluates a SQL query to decide whether to show the group.
- Group N: The process repeats for each visible group.
- Summary: Before selecting the file, a summary of all filled values is shown. The user can go back to correct.
- File: The user selects the file and clicks "Continuar" to see the preview.
- Preview: The first parsed rows are shown according to the pipeline configuration.
- Confirm: The user confirms the load. Singularity delete, insert, and pipeline are executed.
Flow without groups (legacy)
If no groups are configured, all campos_carga and the file selector are shown in a single step, followed by preview and confirmation.
select whose options are defined with a SQL query (SQL:SELECT...) are dynamically reloaded when navigating between groups. If the SQL query contains {{field}}, the referenced field's value is automatically substituted, enabling dependent selects (e.g., a "Category" field that filters the options of a "Subcategory" field).
Upload without file
If the pipeline is configured as "Sin fichero" (no file / pipeline without table), the flow skips file selection and preview. The user only fills in the campos_carga and confirms. This is useful for actions like registering manual data or executing processes that don't require an input file.
BPM actions in the portal
If a bloque has configured actions (Actions tab in the main interface), portal users can execute them from the history view.
How they work
- In a bloque's load history, each entry with available actions shows an "Acciones" (Actions) button in the top-right corner.
- When clicked, the list of available actions expands, filtered by the load's current
estado_bpm. - The user selects an action.
- If the action's pipeline has campos_carga, a modal opens to fill them in.
- Upon confirmation, the pipeline executes on the existing load.
- The result (success, error, result tables) is shown to the user.
estado_origen only appear when the load is in that state. If the load has no estado_bpm (no Kanban configured), only actions without estado_origen (those with NULL) are shown. If the bloque has no configured actions, the "Acciones" button does not appear.
Differences between portal and main interface
| Feature | Main interface ({M}aker) | Portal |
|---|---|---|
| Access | superadmin, admin, desarrollador roles |
usuario role |
| Configuration | Full: queries, reports, packs, pipelines, bloques, apps, Kanban, actions | None: operation only (upload, view status) |
| Data upload | Same flow with full wizard | Same flow with full wizard |
| Kanban | Full board with drag & drop, state and transition configuration | Not available (actions from history only) |
| BPM Actions | From load detail and Kanban board | From load history |
| Table data | "Datos" tab with paginated table and SQL console | Not available |
| Administration | User, company, permission management | Not available |
Independent session
The portal has its own authentication system (portal/auth.php), independent from {M}aker's main session. This means:
- The portal login is a separate screen with its own form.
- Portal and main interface sessions are independent.
- Rate limiting (5 attempts per IP in 15 minutes) applies equally to the portal.
- Session cookies are
HttpOnlyandSameSite=Strictfor security.
Quick guide for administrators
To enable the portal for an end user:
- Create the user with the
usuariorole in the Administration section. - Assign permissions to the user:
dw_apppermission for access to a complete app, ordw_bloquepermission for access to individual bloques.
- Share the portal URL with the user (
/mmaker/portal/). - The user logs in with their credentials and sees only the assigned resources.
usuario role for the client. The client accesses the portal, uploads their data, and can execute actions (like "Approve" or "Reject") from the history. The consulting firm's technical team monitors the process from the main interface using the Kanban board.
Public Forms
Public forms allow you to expose a bloque's campos_carga (upload fields) as a public web form accessible without login, similar to Google Forms or Typeform. Anyone with the link can fill in the form and submit data that gets processed through the bloque's pipeline.
Enabling a public form
- Navigate to the bloque in the DW section of the sidebar.
- Open the Vista (View) tab in the bloque panel.
- Toggle "Formulario publico" (Public Form) on.
- The system automatically generates a unique URL with a token of the form
frm_xxxxxxxxxxxxxxxx. - Copy the URL using the copy button or use "Abrir" (Open) to preview the form.
Configuration options
When the public form is enabled, two configurable options appear:
- Max submissions/hour per user
- Limits the number of submissions per hour from the same browser. Identification is based on an anonymous fingerprint (hash of IP + User-Agent). Default value: 10 submissions/hour. Useful for preventing abuse or accidental duplicate submissions.
- File size limit (MB)
- Maximum allowed size for file attachments uploaded from the form. Default value: 5 MB. Applies per individual file, not to the total submission. Files exceeding this limit are rejected with a clear error message.
External user experience
When a user accesses the public form URL, they see a clean, responsive interface with a light theme, designed for intuitive use:
Form without groups (classic)
If the pipeline has no field groups configured, all fields are shown on a single screen. The user fills in the fields, attaches files if needed, and clicks Submit.
Form with groups (multi-step wizard)
If the pipeline has field groups, the form is presented as a step-by-step wizard:
- Step 1: Fields from the first visible group are shown (based on conditions).
- The user fills in and clicks Continue.
- Intermediate steps: The next group's condition is evaluated. If visible, it's displayed; otherwise, it's skipped.
- Summary: Final screen showing all entered values. The user reviews and confirms.
- Submission: The pipeline executes (same flow as
executeNoFilePipeline).
Visual wizard elements:
- Progress dots: visual indicators of the current step out of the total.
- Progress bar: horizontal bar that advances with each step.
- Back/Continue buttons: smooth navigation between steps.
Result after submission
After submitting the form, the user sees:
- Result tables if the pipeline generates
tablatype steps. - Warnings if the pipeline has
validacion_alarmatype validations. - Generic success message if the pipeline generates neither tables nor warnings.
- A "Submit another" button to return to a clean form for another submission.
validacion_stop that triggers, a full rollback occurs and the user sees an explanatory error message. Make sure your validation messages (mensaje_usuario) are well-written for an external audience.
Supported field types
| Type | Rendering | Notes |
|---|---|---|
input |
Free text field | Simple single-line text |
number |
Numeric field | Client-side numeric format validation |
select |
Dropdown | CSV options (Jan,Feb,Mar) or SQL query (SQL:SELECT...) |
date |
Date picker | Native browser date format |
file |
File picker | Size and extension validation |
Selects with SQL options
Select fields with SQL options (SQL:SELECT...) are resolved in two ways:
- Without
{{field}}variables - Options are pre-resolved server-side when loading the form. The dropdown renders directly with all options.
- With
{{field}}variables (dependent) - Options are loaded dynamically via AJAX when the user changes the value of the field they depend on. The dropdown updates in real time. This enables cascading selects (e.g., select country then cities load for that country).
Anonymous user
Uploads generated by public forms are attributed to a system user anonimo@sistema automatically created per company. This user:
- Cannot log in to {M}aker or the portal.
- Exists solely as a reference for anonymous uploads.
- Is created once per company the first time a submission is received.
- Uploads from this user appear in the bloque's history like any other upload, identified by the name
anonimo@sistema.
Security
Public forms implement several layers of protection:
| Measure | Detail |
|---|---|
| Rate limiting | Configurable submission limit per hour per fingerprint (IP + User-Agent). Exceeding the limit returns a clear error. |
| File size limit | Configurable maximum size per file attachment. Validated both client-side and server-side. |
| Extension whitelist | Only safe file extensions are accepted. Executable extensions (.exe, .bat, .php, etc.) are rejected. |
| No session / no CSRF | The public form requires no user session or CSRF token. Authentication is based solely on the frm_xxx token in the URL. |
| Unique token | Each form has a unique random token. Disabling the toggle invalidates the token. |
Full technical flow
- The user accesses the URL with token
frm_xxx. - The server validates the token and loads the bloque configuration and its effective pipeline.
- Upload fields are rendered (with groups if configured).
- The user fills in fields and attaches files.
- Rate limiting is validated (fingerprint vs configured limit).
- Files are validated (size, extension).
executeNoFilePipelineexecutes with the form values, attributed toanonimo@sistema.- The pipeline processes the data: fixed columns with
campo_carga_refare populated, rows are inserted, steps execute. - The result is returned (tables, warnings, or success message).
Administration
The administration panel allows managing companies, projects, and system users. It requires an admin or superadmin role to access.
admin or superadmin role.
Company hierarchy (consultancy model)
{M}aker organizes companies in a two-level hierarchy that reflects the typical model of a consultancy with projects:
- Parent company (top-level)
- The main entity with
parent_id = NULL. Represents the consultancy or main organization. Resources created here are considered general resources and are accessible from all child projects. - Project (child company)
- A company with
parent_idpointing to the parent company. Represents a specific client or project. Resources created here are isolated: only visible from that project.
Example structure:
Company "Consultancy ABC" (parent_id=NULL)
|-- Admin: ana@consultancy.com
|-- Project "Client Acme" (parent_id=1)
| |-- Developer: dev@consultancy.com
| +-- User: contact@acme.com (portal only)
+-- Project "Client Beta" (parent_id=1)
+-- Developer: other-dev@consultancy.com
Project color
Each project has an automatically assigned color from a palette of 10 colors. This color is used throughout the interface to visually identify which project each resource belongs to:
- Colored dots in the sidebar next to resources from a specific project.
- Grey "G" badge for general resources (from the parent company) when viewing a specific project.
Project selector
The dropdown in the topbar allows filtering the entire interface by project. It is the main mechanism for cross-cutting scoping:
| Selection | What is visible | Where new resources are created |
|---|---|---|
| "All" | Resources from all accessible companies | In the parent company (general) |
| Specific project | Project resources + parent company general resources | In that project |
Visual badges in the sidebar
- "All" view
- General resources (parent company) have no badge. Project resources have a colored dot with the project's color and a tooltip with its name.
- Specific project view
- Resources from the selected project have no badge. General resources have a grey "G" badge to distinguish them.
User management
System roles
| Role | Primary access | Admin access | Scope |
|---|---|---|---|
superadmin |
Entire system | Companies, all users, everything | Global |
admin |
Their company + child projects | Create projects, manage users in their scope | Company + children |
desarrollador |
Full UI ({M}aker) | None | Assigned company |
usuario |
Portal only | None | Permitted resources |
usuario role are automatically redirected to the portal when logging in via index.php. They cannot access the {M}aker configuration UI.
Creating a user
- Go to the Admin section from the topbar.
- In the Users tab, click "New user".
- Fill in the fields:
- Email: must be unique across the entire system.
- Name: display name in the interface.
- Password: initial password.
- Role: select the appropriate role.
- Company: company/project the user belongs to.
- Click Create.
Managing existing users
- Edit
- Modify the user's name, email, or role. Role changes take effect immediately.
- Toggle active/inactive
- Deactivating a user immediately kills all their active sessions. The user will be unable to log in until reactivated.
- Reset password
- Sets a new password and invalidates all active sessions. The user must log in again with the new password.
Permission management
Permissions control which resources a user with the usuario role can see in the portal. The desarrollador, admin, and superadmin roles have full access to resources in their scope without needing explicit permissions.
Resource types with permissions
| Type | Permission effect |
|---|---|
report |
The user can see the report in the portal |
pack |
The user can see the pack in the portal |
dw_bloque |
The user can upload files and view history for the bloque in the portal |
dw_app |
The user can access the app and all its bloques in the portal (inheritance) |
Dual-axis access (apps/bloques)
Access to bloques from the portal works with a dual axis:
- App axis: If permission is granted to an app, the user inherits access to all bloques within that app.
- Bloque axis: Permission can be granted to an individual bloque without granting access to the entire app.
Assigning permissions
- In the Admin section, select a user.
- In their detail view, go to Permissions.
- Select the resources (apps, bloques, reports, packs) you want to assign.
- Save. Changes take effect immediately.
API keys
Each user can have a unique API key for authentication from external integrations:
- Format
sk-mmaker-xxxxxxxxxxxxxxxx- Usage
- Sent as a header
Authorization: Bearer sk-mmaker-xxxin HTTP requests. - Compatible integrations
-
- MCP Server: the {M}aker MCP server uses the API key to authenticate against
api.php. - Excel Add-in: the Excel add-in uses the API key to upload data and query tables.
- MCP Server: the {M}aker MCP server uses the API key to authenticate against
- Security
- Requests with Bearer auth skip CSRF validation (no session or cookies). The API key identifies the user and their company, applying the same access rules as a normal session.
Company management
Creating a company/project
- In the Admin section, Companies tab.
- Click "New company".
- Enter the name. The slug is generated automatically if left blank (URL-safe format: lowercase, no spaces or accents).
- If created by an admin (not superadmin), the company is created as a child project under the admin's company.
Deactivating a company
The active/inactive toggle deactivates the company. Users from that company will be unable to log in. The company's resources continue to exist but are not accessible.
Rate limiting (login)
The system protects against brute force attacks on login:
- 5 failed attempts per IP in 15 minutes = temporary block.
- Generic message: "Too many attempts. Please wait a few minutes."
- After a successful login, attempts for that IP are cleared.
- Old records (>1 hour) are cleaned up probabilistically (1% of requests).
- Applies to both the main login and the portal login.
Power BI Integration
{M}aker connects to Power BI in two ways: via an HTTP launcher (recommended) that requires no MySQL driver, or via a direct MySQL connection (legacy). Additionally, the DW system offers a data API for accessing dynamic tables and named queries directly from Power Query.
Method 1: HTTP Launcher (recommended)
The HTTP launcher is a Power Query M function called mmaker() that downloads each query's code from the server via Web.Contents and executes it with Expression.Evaluate.
How it works
- Power BI invokes
mmaker("query_name", true, true). - The launcher function makes an HTTP call to the
codigo_m_reportendpoint with the report token and query name. - The server resolves the version, substitutes
{{PARAM}}with configured values, and returns M code as plain text. - Power BI executes the code with
Expression.Evaluate(Response, #shared).
Step-by-step setup
- In {M}aker, select the report in the sidebar.
- Open the "Lanzadora" (Launcher) tab.
- Copy the M code block shown (the complete
mmakerfunction). - In Power BI Desktop, create a blank query (Home > Get Data > Blank Query).
- Open the Advanced Editor and paste the launcher code.
- Name this query
mmaker. - To consume a query, create another blank query with:
mmaker("query_name", true, true).
mmaker function appears in Power BI as an invocable function with dropdowns for the Version and Evaluar parameters, thanks to the Documentation.AllowedValues metadata.
Launcher parameters
| Parameter | Type | Values | Description |
|---|---|---|---|
NombreQuery |
text | Query name | Exact name of the query in {M}aker |
Version |
logical | true / false |
true = active version (published); false = draft (development) |
Evaluar |
logical | true / false |
true = execute M code; false = show code as text (debug) |
Config |
nullable record | Optional record (see below) | Optional. Groups staging injections (fields Source, SourceA, SourceB...) and step sampling (field Paso). |
mmaker("query", true, false) returns the M code as text without executing it. Useful for diagnosing errors: you can see exactly what code is being generated, with parameters already substituted.
The Config record
The fourth parameter accepts a record combining two things: the stagings injected into the evaluation environment and the Paso for sampling. All fields are optional.
// Valid examples:
mmaker("calendar", true, true) // no config
mmaker("sales", true, true, [Source = SalesRaw]) // with staging
mmaker("report", true, true, [SourceA = Sales, SourceB = Clients]) // multi-staging
mmaker("sales", true, true, [Paso = "Types"]) // sampling
mmaker("sales", true, true, [Source = SalesRaw, Paso = "Types"]) // combined
Any field starting with Source is injected into the Expression.Evaluate environment with that name (the transform M code references it as if it were a local variable). The Paso field activates sampling mode.
Export step sample (Emulator)
Passing the Paso field in Config extracts data from an intermediate step to feed the {M}aker emulator:
mmaker("Sales_Raw", true, true, [Paso = "Headers"])
This returns a table with the first 50 rows of the "Headers" step. Internally, the server generates M code that runs the query up to that step and serializes the result as JSON, which the launcher parses back into a table.
To use the result in the emulator:
- In Power BI, invoke the function with the fourth parameter.
- Copy the resulting JSON (or export the table).
- In {M}aker, in the Steps view of the query, click "Paste JSON".
- Paste the JSON and select the emulator start step.
Multi-token (parameter RLS)
A report can have multiple tokens, each with its own parameter values. This enables Row-Level Security by parameter scenarios:
- Each token accesses the same queries but with different
{{PARAM}}values. - Example: Token "Spain" with
{{COUNTRY}}= "ES", Token "France" with{{COUNTRY}}= "FR". - Each Power BI user receives a launcher with their specific token.
- Tokens are managed from the report's "Accesos" (Access) tab.
Query types and PBI Service refresh
{M}aker classifies queries into three types based on their content, which determines how they're consumed from Power BI:
| Type | Badge | Content | Usage | Service refresh |
|---|---|---|---|---|
transform |
T | Pure M transformations (Table.*, List.*, Text.*, etc.) — no connectors |
Invoked via mmaker("name", true, true) |
Yes |
staging |
S | Contains connectors (Excel.Workbook, SharePoint.Files, Sql.Database, Web.Contents...) |
Pasted LITERAL as a separate query in the .pbix. Its output is injected into a transform's mmaker Config | Yes (staging is native M code in the .pbix) |
completa |
C | Entire query with connectors, quick & dirty | Invoked via mmaker("name", true, true), but the .pbix must have the Desktop variant of mmaker pasted (same name, body uses #shared) |
No (PBI Service flags "dynamic data source") |
Why connectors can't go inside mmaker
The mmaker launcher passes a curated _env record (~430 pure transformation functions) to Expression.Evaluate, instead of #shared. This is what enables refresh in PBI Service: without connectors in the environment, the service analyzer treats it as a static data source.
If you put Excel.Workbook(...) inside a transform query, refresh would fail with "the name 'Excel.Workbook' cannot be found", because it's not in _env. That's why queries with connectors live as tipo=staging and the connector runs outside Expression.Evaluate (natively in the .pbix).
Automatic division: from original query to staging + transform
When you paste a query with connectors into {M}aker (via "Paste M code" or via the AI assistant), the system detects connectors and proposes automatic division:
- Paste complete code, including SharePoint.Files + Excel.Workbook + subsequent transformations.
- {M}aker detects connectors and shows a preview: "Will create staging X with N steps + transform with M steps".
- Confirm: {M}aker extracts connector steps (and their pure navigation like
Book{[Item="Sheet",Kind="Sheet"]}[Data]) into a newtipo=stagingquery, named{queryName}Connby default. The original query keeps the pure post-frontier steps and its references are rewritten to theSourcealias. - In the report's Access tab you now see two blocks: the staging M code (to paste in .pbix) and the invocation
mmaker("name", true, true, [Source = nameConn]).
sales_by_month and sales_top10 both consume salesConn). In the Access tab each staging appears only once even if used by N transforms — paste the staging code into the .pbix and that's it.
Power BI flow step by step
Imagine a query sales_2026 originally with SharePoint + Excel + transformations, automatically split by {M}aker into:
sales_2026Conn(staging type, with SharePoint.Files + Excel.Workbook)sales_2026(transform type, with Table.PromoteHeaders + Table.TransformColumnTypes, starts withSource)
In Power BI Desktop you paste three queries:
// 1. The launcher (copy from report "Access" tab, SERVICE variant)
mmaker = let Token = "mk_...", RootUrl = "...", ApiPath = "..." in ...
// 2. The staging (copy from "Access" > "Required stagings")
sales_2026Conn = let
Source = SharePoint.Files("https://tenant.sharepoint.com/sites/X", [ApiVersion = 15]),
File = Source{[Name="sales.xlsx"]}[Content],
Book = Excel.Workbook(File, null, true),
Sheet = Book{[Item="Sales",Kind="Sheet"]}[Data]
in Sheet
// 3. The final query (what you'll use in the model)
sales_2026 = mmaker("sales_2026", true, true, [Source = sales_2026Conn])
Server-side changes in sales_2026 (adding calculated columns, new types, filters) are picked up on the next refresh without touching the .pbix. You only need to regenerate the staging if the SharePoint URL or file name changes.
Desktop variant of mmaker (body with #shared)
The Access tab also offers a Desktop variant of the launcher: same function name (mmaker), only the body differs — it uses #shared as environment instead of the curated _env. It supports any query with connectors directly, but the dataset blocks scheduled refresh in Service. Useful for:
- Rapid development (not splitting queries every time)
- Reports only used in Desktop
- Queries marked as
tipo=completa(quick & dirty)
Because both variants share the same name, invocations like mmaker("X", true, true) work with whichever variant is pasted — the .pbix decides which one serves the call. Switching from Desktop to Service is as simple as re-pasting the body in the same mmaker query.
// The invocation is identical regardless of which variant is pasted:
mmaker("my_query_with_excel", true, true)
Alternative pattern: Desktop + OneDrive (unofficial)
When a customer has a single environment with several .pbix files linked to {M}aker and doesn't want to deal with staging/transform discipline or pay for Power BI Premium, there's a known alternative that leverages the Service's OneDrive auto-refresh:
- An always-on machine (mini-PC, VM, or office workstation) with Power BI Desktop installed and data source credentials configured.
- Task Scheduler + PowerShell opens the
.pbix, forces refresh, saves, and closes — at whatever cadence you need. - The
.pbixlives in a folder synced with OneDrive / SharePoint. - Power BI Service detects the change (~1h polling) and imports the snapshot: model, queries AND already-refreshed data.
In this scenario you can use the Desktop variant of mmaker (with #shared) for all your queries, without needing to split into staging/transform. Connectors (Excel, SharePoint, SQL, Web.Contents...) work directly because Desktop handles the refresh locally, not Service.
.pbix or redistributing anything. Versioning, draft/active, per-token params, and emulator still work as usual.
PowerShell refresh script
Power BI Desktop doesn't expose an official CLI for refresh, but it can be automated via SendKeys from PowerShell:
param(
[Parameter(Mandatory=$true)][string]$PbixPath,
[int]$WaitLoadSec = 60, # time to open the .pbix
[int]$WaitRefreshSec = 600 # refresh timeout (adjust to size)
)
Add-Type -AssemblyName System.Windows.Forms
$pbi = "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"
# 1. Open the .pbix
$proc = Start-Process -FilePath $pbi -ArgumentList "`"$PbixPath`"" -PassThru
Start-Sleep -Seconds $WaitLoadSec
# 2. Focus the window
$title = [IO.Path]::GetFileNameWithoutExtension($PbixPath)
$shell = New-Object -ComObject WScript.Shell
$shell.AppActivate("$title - Power BI Desktop") | Out-Null
Start-Sleep -Seconds 2
# 3. Refresh (Ctrl+Shift+F5 = Refresh All)
[System.Windows.Forms.SendKeys]::SendWait("^+{F5}")
Start-Sleep -Seconds $WaitRefreshSec
# 4. Save
$shell.AppActivate("$title - Power BI Desktop") | Out-Null
[System.Windows.Forms.SendKeys]::SendWait("^s")
Start-Sleep -Seconds 15
# 5. Close
[System.Windows.Forms.SendKeys]::SendWait("%{F4}")
Start-Sleep -Seconds 5
if (!$proc.HasExited) { $proc | Stop-Process -Force }
Save as refresh-pbix.ps1 and schedule in Task Scheduler with:
powershell.exe -File "C:\scripts\refresh-pbix.ps1" -PbixPath "C:\OneDrive\reports\sales.pbix"
When this pattern fits
- Single customer / tenant with up to ~20 reports.
- Already uses OneDrive / SharePoint as file repository.
- Tolerates cumulative latency (Desktop cadence + OneDrive sync + Service caching).
- Doesn't need DirectQuery or near-real-time.
- Wants maximum development convenience: connectors anywhere, no staging.
Limitations and caveats
- Fragility:
SendKeysdepends on the active window and heuristic timings. If refresh takes longer than the timeout, you save mid-refresh. For serious production, consider Power Automate Desktop (recognizes icons/windows more robustly and detects refresh completion better). - Scale: everything goes through one machine. Dozens of large reports saturate the scheduler — everything serializes.
- Always-on machine: operationally equivalent to an on-prem gateway (Windows, local credentials, maintenance), though architecturally they are different things.
- Service doesn't orchestrate: no centralized refresh logs, no native alerts if one fails — you have to build those outside.
- Not multi-tenant: each tenant needs its own machine with its own Desktop and its own credentials.
Method 2: Direct MySQL (legacy)
This method connects Power BI directly to the MySQL database to read queries and steps.
Setup:
- Install the MySQL ODBC Connector (version 8.x or higher).
- In {M}aker, go to the "Integrar en Power BI" (Integrate with Power BI) panel.
- Copy the MySQL launcher M code block.
- In Power BI, paste as a blank query.
- The launcher reads directly from the
queriesandquery_pasostables via ODBC.
DW Data API
The DW Data API allows accessing Data Warehouse dynamic tables from Power BI without needing an ODBC driver or exposing MySQL.
Authentication
All DW Data API endpoints use the report token for authentication (the same token as the launcher). The token resolves the user's company and grants access to all DW tables for that company.
Available endpoints
| Endpoint | Description | Usage |
|---|---|---|
dw_tables |
List company DW tables | Metadata: name, row count, columns with types |
dw_data |
Paginated table data | Rows as arrays, column metadata, has_more flag for pagination |
dw_code |
Auto-generated M code | M code with List.Generate for transparent pagination |
Using DW tables from Power BI
- In {M}aker, open the report's "Lanzadora" (Launcher) tab (or the token's if using multi-token).
- In the "Tablas DW (API)" section, you will see the list of available tables.
- Click "Copiar M" (Copy M) next to the desired table.
- In Power BI, paste as a blank query. The code already includes:
- Transparent pagination via
List.Generate(automatically handles large tables). Table.TransformColumnTypeswith correct column types.- Authentication with the report token.
- Transparent pagination via
List.Generate pagination in the M code handles this transparently: it keeps requesting pages until has_more = false.
DW Named Queries
DW named queries are SQL queries saved on the server, executable via API with a token. They allow creating complex SQL queries that execute server-side and are consumed from Power BI as just another table.
Key features
- The SQL executes on the server and is not visible in Power BI. The PBI user only sees clean M code with
Web.Contentscalls. - Only
SELECTqueries are allowed (server-side validation). - Support transparent pagination just like DW tables.
- Can be created from the chat assistant or from the query editor in the UI.
Endpoints
| Endpoint | Description |
|---|---|
dw_sql |
Executes the named query and returns paginated data |
dw_consulta_code |
Auto-generated M code for the query (with pagination) |
Creating a DW query
There are three ways to create DW queries:
- From the chat assistant
- Ask the assistant to create a query. It automatically uses the
crear_consulta_dwtool and generates the corresponding M query. - From the query editor
- In the "Add step" dropdown of a query, select "DW (data connection)". Fill in the query name and SQL. The system creates the DW query and the necessary M steps.
- From the DW Queries section
- Direct management: create, edit, and delete named SQL queries.
Linked DW query in the step editor
When editing a query step that references a DW query (the M code contains action="dw_sql"...consulta="name"), the edit modal automatically shows:
- The detected query name.
- An editable SQL textarea (with intellisense).
- When saving the step, the DW query SQL is saved simultaneously.
Web.Contents API calls.
BI Credentials (ODBC credentials)
For direct ODBC connections to the DW database (legacy or advanced scenarios), {M}aker creates read-only MySQL users per company.
- User format
mmaker_bi_{empresa_id}(e.g.,mmaker_bi_1)- Permissions
SELECTonly on themmaker_dwdatabase. AGRANT SELECTis automatically issued every time a DW table is created or modified.- Management
-
- Create: Endpoint
crear_bi_credentials. Generates user + random password. - Regenerate: Endpoint
regenerar_bi_credentials. Changes the existing user's password. - View: Endpoint
bi_credentials. Returns user and host (password only on create/regenerate).
- Create: Endpoint
dw_{empresa_id}_* tables belonging to their company in the mmaker_dw database. It has no access to the system database (mmaker).
Quick reference: which method to choose
| Scenario | Recommended method |
|---|---|
| Centralized M queries without driver | HTTP Launcher |
| DW data without exposing MySQL | DW Data API (dw_data / dw_sql) |
| Complex SQL hidden from PBI user | DW Named Queries (dw_sql) |
| Direct MySQL connection (legacy) | BI Credentials + ODBC |
| Single customer, few reports, no gateway (unofficial) | Desktop variant + local scheduled refresh + OneDrive |
| Power BI Service (cloud) | HTTP Launcher + DW Data API (only methods without gateway) |
Chat Assistant
The chat assistant is a side panel with integrated artificial intelligence in {M}aker. It is connected to the Claude API (Anthropic) with tool_use capability, allowing it to execute actions directly on the system: create queries, modify steps, configure Kanban, execute BPM actions, and more.
Automatic context
The assistant automatically receives the context of your current session:
- Selected query
- If you have an active query in the panel, the assistant knows its name, steps, and code. It can modify it directly.
- Active report
- If you have a report selected, the assistant knows its ID, token, and API URL. It uses this information to generate M code with the correct tokens.
- Active bloque/pipeline
- If you are in a DW bloque, the assistant knows its configuration, tables, and associated pipeline.
Assistant capabilities
Query management
The assistant can perform all these operations directly:
- Create queries: Generates complete queries with multiple steps. If the name already exists, it updates the steps as a new version (upsert).
- Modify steps: Edits the M code of individual steps.
- Add steps: Adds new steps to an existing query (via draft).
- Delete steps: Removes steps from the active query.
- Assign to report: Assigns a query to a report. Assignment is idempotent (if already assigned, it does not fail).
query_id=0 in asignar_query_report. The system automatically substitutes the ID of the just-created query.
DW Named Queries
The assistant follows a specific flow for creating DW data connections:
- Create SQL query: Uses the
crear_consulta_dwtool to save the SQL on the server. The query uses upsert: if the name exists, it updates the SQL. - Create M query: Generates the Power Query M steps that call
dw_sqlviaWeb.Contentswith transparent pagination. - Assign to report: Links the query to the active report.
Web.Contents + the dw_sql API for DW data. It never generates code with Odbc.Query or MySQL.Database(). The SQL stays hidden on the server and the Power BI user only sees clean M code.
BPM / Kanban
The assistant can configure and operate the full BPM system:
| Capability | Tool | Description |
|---|---|---|
| Configure Kanban states | configurar_kanban |
Define board states: name, color, initial, final, order |
| Configure transitions | configurar_kanban_transiciones |
Define allowed movements between states with optional pipeline |
| Create actions | crear_accion_carga |
Define pipelines that can be invoked on a bloque's uploads |
| Execute actions | ejecutar_accion |
Execute a pipeline on an existing upload |
| Move uploads | mover_carga_kanban |
Move an upload between Kanban states |
| Configure cards | configurar_kanban_tarjeta |
Define which variables to display on Kanban cards |
Best practices
Optimal context
For the best results from the assistant:
- Select the report before asking it to create a DW query. The assistant will use the report's token to generate the M code.
- Be specific with table and column names. The assistant knows available DW tables but appreciates exact names.
- Request complete operations: instead of "create a SQL query", say "create a Power Query that shows sales by month for the last year, using the dw_sales table". The assistant will create the SQL query, the M query, and assign it to the report in a single interaction.
Chained operations
The assistant can execute multiple tools in a single response. Typical example:
- Creates a DW query with the SQL.
- Creates an M query with 3 steps (Data, Table, Result).
- Assigns the query to the active report.
All of this happens in a single chat interaction. If a step fails, the assistant reports the error and suggests corrections.
Cascading modifications
When the assistant changes a source or connection step in a query, it automatically reviews all subsequent steps that may be affected and issues all necessary modifications in a single response.
Conversation structure
- The conversation persists throughout the browser session.
- The assistant remembers context from previous messages.
- When switching queries or reports, the context updates automatically.
- Each tool call is displayed in the chat as an executed action, with its result.
Limitations
- The assistant cannot upload files or execute DW uploads directly.
- It does not have access to DW table data (only structure/metadata).
- Delete operations request confirmation before executing.
- Chat history does not persist between browser sessions.
chat.php as a proxy, which adds system context and tool definitions before sending to the API.
RLS Distribution — User-filtered Power BI without publishing
{M}aker's RLS (Row-Level Security) mode lets you distribute the same Power BI report to multiple users and have each one see data filtered by their role, without publishing to Power BI Service or setting up gateway, dynamic RLS, or Pro/Premium licenses.
mk_u_...) that resolves server-side to a set of parameters. The M launcher uses that token and receives already-filtered data. Everything happens in Power BI Desktop via Web.Contents.
How it works
- Admin creates token-roles on the report (e.g. "North", "South") with different
{{REGION}}values. - Toggles RLS on in the Access tab → auto-generates the "Mis Reports" App, the "Report PBI" Pipeline and a bloque linked to the report.
- Assigns each user to a token-role → generates a personal
user_token(mk_u_...). - Admin uploads a
.pbitto the bloque (via portal) with the M launcher prepared and aMakerTokenparameter. - Each user opens the portal, copies their personal token, downloads the
.pbitand opens it in Power BI Desktop. - Power BI asks for the
MakerTokenparameter value on open — the user pastes their token. - Save as
.pbix. On every refresh, the server returns data filtered by the token.
Step-by-step setup (admin)
1. Create token-roles
In the report's Access tab, create one token per parameter combination. Example for a report with {{REGION}}:
- Token "North Team" →
REGION = "North" - Token "South Team" →
REGION = "South" - Token "Management" →
REGION = "%"(sees everything)
2. Enable RLS
In the Access tab, turn on the "RLS Distribution" toggle. The system:
- Creates the "Mis Reports" App (1 per company) if it doesn't exist
- Creates the shared "Report PBI" Pipeline (no table, fields: comment + .pbit/.pbix file)
- Creates a bloque linked to the report with
report_idpointing to it
3. Assign users
Under each token-role, click "+ Assign" and pick the user. Their personal user_token is generated automatically.
4. Prepare the launcher with parameter
With RLS active, the Launcher tab shows instructions about the MakerToken parameter and generates M code using Token = MakerToken instead of a hardcoded token:
let
Token = MakerToken, // Power BI parameter
BaseUrl = "https://your-server/mmaker/api.php",
...
5. Create the MakerToken parameter in Power BI Desktop (admin only, one time)
This setup is done by the admin once when preparing the file. End users do NOT need to create the parameter — they receive it already defined inside the .pbit.
- Open Power BI Desktop with a blank or existing report
- Home → Manage parameters → New
- Name:
MakerToken - Type: Text
- Current value: any valid token (e.g. your own as admin) — only used so PBI can execute the report during design
- In the Advanced Editor of the
mmakerquery, paste the M launcher (which referencesToken = MakerToken) - Design the report with your visuals
- File → Save As → type Power BI Template (.pbit)
.pbit, Power BI stores the parameter definition but not its value. When a user opens the .pbit, PBI Desktop automatically prompts them for the parameter value in a modal dialog. The user just pastes their personal token there — no further setup required.
6. Upload the .pbit to the bloque
In the portal, open the report's bloque (under the "Mis Reports" App), click Upload version and attach the .pbit. Optionally add a version comment.
For the end user
The user enters the portal and sees the bloque with a "Report" badge. When opening it:
- Current version: highlighted card with the latest .pbit and download button
- Your access: personal token with Copy button
- Connect Power BI: numbered flow instructions
- Version history: earlier downloadable versions
User flow (4 steps)
- Copy your personal token from the portal (Copy button)
- Download the
.pbitof the current version - Open the file — Power BI Desktop launches a dialog asking for the
MakerTokenparameter value. Paste your token and click Load. - Save as .pbix via File → Save As. Your token is stored in the file. On subsequent refreshes it won't be asked again.
.pbit, paste the token in the automatic prompt and save. The parameter is already defined inside the template thanks to the admin's work in step 5.
Security and validation
- The
user_tokenis opaque (mk_u_<40 hex>) — does not expose internal structure - Every request to
codigo_m_reportwith a user_token is validated in real time: user active, token-role active, report active - Revoking a user (x button in the table) takes effect immediately on the next refresh
- Each call is logged in
report_usage_logwith user, query, IP and timestamp
Usage statistics
In the Access tab, the assigned users table shows:
- Last use: date of the user's last request
- 30d: number of refreshes in the last 30 days
Advantages over Power BI Service RLS
| Aspect | Traditional RLS (PBI Service) | {M}aker RLS |
|---|---|---|
| License | Pro or Premium | Free Power BI Desktop only |
| Gateway | Required for on-premise DBs | Not required (HTTP) |
| Logic changes | Republish .pbix | Change in {M}aker → next refresh |
| Per-user parameters | DAX roles + assignments | Token-roles in {M}aker |
| Revocation | Remove workspace access | Revoke user-token (immediate) |
| Usage audit | PBI activity log | report_usage_log in {M}aker |
RLS in Excel (Power Query reports in Excel workbooks)
If instead of Power BI you distribute reports as .xlsx/.xltx with Power Query, you can also use RLS. Excel doesn't have the automatic prompt .pbit has, but there's a simple convention: a named cell MakerToken.
Workbook preparation (admin / designer)
- In a visible sheet, select a cell (e.g.
Config!B2) - In the Name Box (top left), type
MakerTokenand press Enter - In the Power Query editor, define
Tokenreading from that cell:Token = Excel.CurrentWorkbook(){[Name="MakerToken"]}[Content]{0}[Column1] - Next to the cell, add a label like "Paste your personal {M}aker token here" to guide the user
- Save as
.xltx(Excel Template) with the cell empty — opening the template creates a fresh.xlsxfor each user
Use for the end user
Two ways to fill the cell:
Option A — Manual
- User copies their token from the portal
- Opens the template, pastes the token in the
MakerTokencell - Refreshes data (Data → Refresh All)
- Saves as
.xlsx
Option B — With the {M}aker Excel Add-in
The {M}aker Excel Add-in includes an "RLS" tab that shows all the user's personal tokens:
- Open the add-in from Excel (top bar → {M}aker add-in)
- Go to the RLS tab
- Click "Paste in MakerToken" on the token of the report you'll use
- The add-in writes the token directly in the cell — one click
MakerToken.
Differences vs Power BI
| Power BI (.pbit) | Excel | |
|---|---|---|
| Prompt on open | Yes, automatic | No — manual cell |
| Token saved on close | Inside .pbix | Inside .xlsx (sheet) |
| Visibility | Hidden in parameters | Visible in the cell (sheet can be hidden) |
| Client setup | Paste in dialog | Paste in cell (or add-in) |
Licensing & Limits
All account limits (reports, queries, monthly loads, AI tokens, storage, etc.) resolve live from a central configurable layer. This section explains the model, how to check your usage, and what happens when you reach a limit.
Concepts
Products and tiers
{M}aker combines three products:
- CODE (always base): Solo · Studio · Agency. Governs M queries, reports, packs, RLS tokens.
- DATA (add-on): Light · Pro · Scale. Adds DW tables, pipelines, loads, mailings, BPM.
- FORMS (DATA add-on): Forms Plus · Forms Pro. High-volume public forms.
Limits (tier_limits)
Each tier defines metric-level limits (e.g. reports: 25, storage_gb: 25). A value of -1 means unlimited.
Prices (tier_prices)
Each tier has monthly and annual prices, in public or early_access flavor. Annual ≈ 10 months paid (~17% off).
Per-subscription overrides
A subscription can have individual exceptions: different limits or price from the base tier, with a reason and optional expiration. Used for custom agreements, specific-client trials, or lower caps for early testers.
Resolution cascade
When asking "what's the queries limit for this company?":
- Look for active override in
subscription_overrides→ wins if it exists. - Otherwise → use the value in
tier_limitsfor the current tier. - If the company has no subscription for that product → limit = 0 (blocked).
Billing panel (Admin tab)
Admin → Billing shows:
- Redeem code: input for early-access vouchers.
- My subscriptions: products, tier, cycle, status, expiration.
- AI Chat: monthly token quota, progress bar, BYOK configuration.
- Active exceptions: overrides applied to your account (only shown if any).
- Current usage: per-metric table (usage / limit / bar).
80% and 95% alerts
When a metric reaches 80% or 95% of its limit, a fixed banner under the topbar shows:
- Warning icon (⚠ for 80%, ⛔ for 95%).
- Metric name + current / limit + percentage.
- View billing button, linking to the tab.
- Close button (the alert won't reappear in session unless it escalates to danger).
The banner auto-refreshes every 5 minutes.
Behavior at 100%
| Metric | Behavior |
|---|---|
reports, queries, packs, apps, blocks, pipelines, named_queries, projects, devs, portal_users, schedules, ftp_destinations, rls_tokens | Creation blocked. HTTP 402 with "Plan limit exceeded". |
monthly_loads | New loads blocked (file, schedule, radar, action). Existing data remains queryable. |
mailings_month | Pipeline mailing step skipped with warning, pipeline continues. |
ai_tokens_month | Chat disabled until 1st of next month or BYOK setup. |
storage_gb (Light/Pro) | Write blocked on mmaker_dw. Read still works. |
storage_gb (Scale) | Auto overage (€0.50/GB/month), hard cap at +50% of tier. |
AI Chat: courtesy vs BYOK
Courtesy quota
Each CODE tier includes monthly courtesy tokens:
- Solo: 200,000 tokens
- Studio: 500,000 tokens
- Agency: 1,000,000 tokens
Resets on the 1st of each calendar month. Not cumulative.
BYOK (Bring Your Own Key)
You can configure your own Anthropic API key instead of using courtesy:
- No monthly cap — you pay the provider directly.
- Ideal for heavy use.
- Setup: Admin → Billing → AI Chat → "Configure BYOK".
- Key is stored encrypted (AES-256) on your account.
Access codes (vouchers)
Superadmins can generate nominative codes from Admin → Licensing → Codes. Types:
- Free indefinite: active until revoked (early testers, MVPs).
- Free with duration: active for N months.
- With custom overrides: raise/lower specific limits (e.g.
{"ai_tokens_month": 2000000}).
A code can be:
- By email: only redeemable by a user with that email (flexible — company is created on redeem).
- By company: only redeemable by a specific company (rigid).
- Open: any user with the code can redeem (limited by
usos_max).
Redemption
Two paths:
- During registration: at register.php, the code is required (no free trial in early access).
- From an existing account: Admin → Billing → "Redeem code".
Revocation
Superadmin can revoke a code from Admin → Licensing → Codes. Immediate effect: derived subscription becomes cancelled and the account loses tier limits (falls back to legacy if no other subscriptions).
Management (superadmin)
Admin → Licensing has 5 tabs:
- Codes: generate, revoke, see redemptions.
- Subscriptions: view all system subscriptions, manage overrides.
- Partners: CRUD for Certified/Strategic partners with commission tracking.
- Limits: edit
tier_limits(immediate global changes). - Prices: edit
tier_prices. Changes reflect on/pricingafter reload.
Public pricing page
Available at /mmaker/pricing.php. Live reads from tier_prices and tier_limits. Bilingual ES/EN. CTA links to register.php.
Database (reference)
subscriptions: active subscriptions per company and product.tier_limits,tier_prices: editable catalogs.subscription_overrides: individual exceptions.access_codes,access_code_redemptions: vouchers and redemptions.usage_metrics: monthly counters (loads, mails, AI tokens).ai_usage_log: detailed chat call log.byok_config: encrypted BYOK config.lifecycle_events: audit of subscription changes, redemptions, warnings.partners,partner_attributions,partner_commissions: partner program.