cURL
curl --request POST \
--url https://api.nfig.ai/apis/request/workflow/step/run/<id> \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '{
"step": "<step>",
"type": "<stepType>",
"schema": {
"<openapi-schema>"
}
}'import requests
url = "https://api.nfig.ai/apis/request/workflow/step/run/<id>"
headers = {
"Content-Type": "application/json",
"api-key": "<api-key>"
}
payload = {
"step": "<step>",
"type": "<stepType>",
"schema": {
# Add your OpenAPI schema here
# "<openapi-schema>"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())const url = 'https://api.nfig.ai/apis/request/workflow/step/run/<id>';
const headers = {
'Content-Type': 'application/json',
'api-key': '<api-key>'
};
const payload = {
step: '<step>',
type: '<stepType>',
schema: {
// "<openapi-schema>"
}
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));<?php
$url = "https://api.nfig.ai/apis/request/workflow/step/run/<id>";
$headers = array(
"Content-Type: application/json",
"api-key: <api-key>"
);
$payload = array(
"step" => "<step>",
"type" => "<stepType>",
"schema" => array(
// Add your OpenAPI schema here
// "<openapi-schema>"
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.nfig.ai/apis/request/workflow/step/run/<id>"
payload := map[string]interface{}{
"step": "<step>",
"type": "<stepType>",
"schema": map[string]interface{}{
// Add your OpenAPI schema here
// "<openapi-schema>"
},
}
jsonPayload, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("api-key", "<api-key>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class WorkflowStepRun {
public static void main(String[] args) {
try {
URL url = new URL("https://api.nfig.ai/apis/request/workflow/step/run/<id>");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("api-key", "<api-key>");
conn.setDoOutput(true);
String jsonInput = String.format("""
{
"step": "%s",
"type": "%s",
"schema": {
%s
}
}
""",
"<step>",
"<stepType>",
"<openapi-schema>"
);
try(OutputStream os = conn.getOutputStream()) {
byte[] input = jsonInput.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int responseCode = conn.getResponseCode();
System.out.println("Response Code: " + responseCode);
conn.disconnect();
} catch(Exception e) {
e.printStackTrace();
}
}
}require 'uri'
require 'net/http'
url = URI("https://api.nfig.ai/apis/request/workflow/step/run/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step\": \"Go to amazon.com\",\n \"type\": \"ACT\",\n \"schema\": {}\n}"
response = http.request(request)
puts response.read_body{
"stepId": "<string>",
"jobTaskId": "<string>"
}Workflow Step Mode APIs
Execute an individual step
POST
/
apis
/
request
/
workflow
/
step
/
run
/
{id}
cURL
curl --request POST \
--url https://api.nfig.ai/apis/request/workflow/step/run/<id> \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '{
"step": "<step>",
"type": "<stepType>",
"schema": {
"<openapi-schema>"
}
}'import requests
url = "https://api.nfig.ai/apis/request/workflow/step/run/<id>"
headers = {
"Content-Type": "application/json",
"api-key": "<api-key>"
}
payload = {
"step": "<step>",
"type": "<stepType>",
"schema": {
# Add your OpenAPI schema here
# "<openapi-schema>"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())const url = 'https://api.nfig.ai/apis/request/workflow/step/run/<id>';
const headers = {
'Content-Type': 'application/json',
'api-key': '<api-key>'
};
const payload = {
step: '<step>',
type: '<stepType>',
schema: {
// "<openapi-schema>"
}
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));<?php
$url = "https://api.nfig.ai/apis/request/workflow/step/run/<id>";
$headers = array(
"Content-Type: application/json",
"api-key: <api-key>"
);
$payload = array(
"step" => "<step>",
"type" => "<stepType>",
"schema" => array(
// Add your OpenAPI schema here
// "<openapi-schema>"
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.nfig.ai/apis/request/workflow/step/run/<id>"
payload := map[string]interface{}{
"step": "<step>",
"type": "<stepType>",
"schema": map[string]interface{}{
// Add your OpenAPI schema here
// "<openapi-schema>"
},
}
jsonPayload, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("api-key", "<api-key>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class WorkflowStepRun {
public static void main(String[] args) {
try {
URL url = new URL("https://api.nfig.ai/apis/request/workflow/step/run/<id>");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("api-key", "<api-key>");
conn.setDoOutput(true);
String jsonInput = String.format("""
{
"step": "%s",
"type": "%s",
"schema": {
%s
}
}
""",
"<step>",
"<stepType>",
"<openapi-schema>"
);
try(OutputStream os = conn.getOutputStream()) {
byte[] input = jsonInput.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int responseCode = conn.getResponseCode();
System.out.println("Response Code: " + responseCode);
conn.disconnect();
} catch(Exception e) {
e.printStackTrace();
}
}
}require 'uri'
require 'net/http'
url = URI("https://api.nfig.ai/apis/request/workflow/step/run/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step\": \"Go to amazon.com\",\n \"type\": \"ACT\",\n \"schema\": {}\n}"
response = http.request(request)
puts response.read_body{
"stepId": "<string>",
"jobTaskId": "<string>"
}Authorizations
Path Parameters
Unique identifier for each workflow session
Body
application/json
⌘I