BlocksNetwork

http in

Receive HTTP requests and turn them into messages that start a flow.

http in Block

The http in block is used to receive HTTP requests and start workflows from external systems. It creates an HTTP endpoint that can be called from web applications, APIs, or other services to trigger your AIStudio workflows.

Overview

The http in block acts as the entry point for creating REST API endpoints with your AIStudio workflows. When combined with an http response block, it allows you to build complete API services that can process documents, run AI models, and return results.

In the current editor UI, the visible configuration is:

  • method: currently exposed as POST
  • upload: optional file-upload handling
  • url: endpoint path
  • name
  • swaggerDoc: optional API documentation reference

What the block sends

For POST requests, the block sends a message with:

  • msg.payload: parsed request body
  • msg.req: the incoming request object
  • msg.res: the response wrapper used by http response

Important request properties commonly used downstream:

  • msg.req.headers
  • msg.req.query
  • msg.req.params
  • msg.req.body
  • msg.req.files when upload is enabled
  • msg.req.method
  • msg.req.originalUrl

Input and output shape

This node has no input and one output.

Example request

POST /api/process
Content-Type: application/json

{
  "document_id": "doc-1001",
  "priority": "high"
}

Example message created by the node

{
  "payload": {
    "document_id": "doc-1001",
    "priority": "high"
  },
  "req": {
    "method": "POST",
    "query": {},
    "params": {},
    "headers": {
      "content-type": "application/json"
    }
  },
  "res": {}
}

File uploads

If upload is enabled:

  • multipart form uploads are accepted
  • uploaded files are available in msg.req.files
  • other submitted fields are available in the parsed request body

URL rules

  • The configured URL is registered as an HTTP path.
  • If the path does not start with /, the runtime adds it.
  • The final endpoint is created under the runtime's HTTP root.

Example

Block configuration

{
  "method": "post",
  "url": "/api/upload",
  "upload": true
}

Example output message

{
  "payload": {
    "category": "invoice"
  },
  "req": {
    "files": [
      {
        "fieldname": "file"
      }
    ]
  },
  "res": {}
}

Limitations

  • In the current editor configuration, only POST is exposed to users.
  • This block only receives requests; it does not send the HTTP response by itself.
  • Every HTTP flow should end with an http response block.

Common mistakes

  • Forgetting to connect an http response block later in the flow.
  • Expecting uploaded files in msg.payload instead of msg.req.files.
  • Using a URL without considering the runtime HTTP root.