Run Python compute workloads anywhere, with only a predict function.
Get the duration between two dates in days, hours, minutes, and seconds along with checking if they are the same.
Format a date string to another date string. For more examples on formatting, see the Sugar Date Format documentation.
The Function API allows you to run code snippets in various programming languages directly through API calls. This capability can extend Pipedream workflows by enabling custom logic processing, data transformation, or any operation that requires server-side code execution without deploying or managing servers. By using the Function API, you can incorporate code that's beyond the native actions available within Pipedream, offering a flexible and powerful way to handle complex tasks in your automations.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
function: {
type: "app",
app: "function",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.fxn.ai/user`,
headers: {
Authorization: `Bearer ${this.function.$auth.api_key}`,
},
})
},
})
export default defineComponent({
async run({ steps, $ }) {
const text = ' Hello world! ';
return text.trim()
},
})